From e928d8baf2d3ac48141eaddb522aef6361542971 Mon Sep 17 00:00:00 2001
From: Koichiro IWAO
Date: Tue, 7 Jan 2020 19:24:17 +0900
Subject: [PATCH 1/2] common: flush stream in g_deinit()
unless flushing stream before exitting, `xrdp --version | cat` will
show empty output.
Fixes #1471.
---
common/os_calls.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/common/os_calls.c b/common/os_calls.c
index 2b4e0e9b..54b2c3ed 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -166,6 +166,8 @@ g_deinit(void)
#if defined(_WIN32)
WSACleanup();
#endif
+ fflush(stdout);
+ fflush(stderr);
g_rm_temp_dir();
}
From e8c845e78bb5c1a87726ff971eef4a2f6346910f Mon Sep 17 00:00:00 2001
From: Koichiro IWAO
Date: Wed, 8 Jan 2020 09:21:39 +0900
Subject: [PATCH 2/2] common: switch _exit to exit
mentioned in #1472.
---
common/os_calls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/os_calls.c b/common/os_calls.c
index 54b2c3ed..88b96e61 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -3400,7 +3400,7 @@ g_getenv(const char *name)
int
g_exit(int exit_code)
{
- _exit(exit_code);
+ exit(exit_code);
return 0;
}