diff options
author | Koichiro IWAO <meta@vmeta.jp> | 2017-05-16 11:59:15 +0900 |
---|---|---|
committer | metalefty <meta@vmeta.jp> | 2017-06-20 14:29:02 +0900 |
commit | 1d89000d90ddb5f6d18dcc8c724a9aeb8954ea07 (patch) | |
tree | 1cf162e0a5a66ac4c6dc024fb750dabff75b8687 /xrdp/xrdp.c | |
parent | 7aad2c83c6b937ca6b3e96c489b58e415d57b4e5 (diff) | |
download | xrdp-proprietary-1d89000d90ddb5f6d18dcc8c724a9aeb8954ea07.tar.gz xrdp-proprietary-1d89000d90ddb5f6d18dcc8c724a9aeb8954ea07.zip |
xrdp: exit main process with failure status if listen failed (daemon mode)
Diffstat (limited to 'xrdp/xrdp.c')
-rw-r--r-- | xrdp/xrdp.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index 54613ac3..cdd611f5 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -550,7 +550,17 @@ main(int argc, char **argv) if (0 != pid) { - g_writeln("process %d started ok", pid); + /* if can't listen, exit with failure status */ + if (xrdp_listen_test() != 0) + { + log_message(LOG_LEVEL_ERROR, "Failed to start xrdp daemon, " + "possibly address already in use."); + g_deinit(); + /* must exit with failure status, + or systemd cannot detect xrdp daemon couldn't start properly */ + g_exit(1); + } + g_writeln("daemon process %d started ok", pid); /* exit, this is the main process */ g_deinit(); g_exit(0); |