From fff61cbeca9c6cb4687c534c081540d6f593a4c0 Mon Sep 17 00:00:00 2001 From: Koichiro IWAO Date: Thu, 28 Mar 2019 15:58:29 +0900 Subject: [PATCH] xrdp: do not exit when caught SIGHUP --- xrdp/xrdp.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index d2643e98..294260c2 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -163,6 +163,13 @@ xrdp_child(int sig) } } +/*****************************************************************************/ +void +xrdp_hang_up(int sig) +{ + log_message(LOG_LEVEL_INFO, "caught SIGHUP, noop..."); +} + /*****************************************************************************/ /* called in child just after fork */ int @@ -644,9 +651,10 @@ main(int argc, char **argv) g_threadid = tc_get_threadid(); g_listen = xrdp_listen_create(); g_signal_user_interrupt(xrdp_shutdown); /* SIGINT */ - g_signal_pipe(pipe_sig); /* SIGPIPE */ - g_signal_terminate(xrdp_shutdown); /* SIGTERM */ - g_signal_child_stop(xrdp_child); /* SIGCHLD */ + g_signal_pipe(pipe_sig); /* SIGPIPE */ + g_signal_terminate(xrdp_shutdown); /* SIGTERM */ + g_signal_child_stop(xrdp_child); /* SIGCHLD */ + g_signal_hang_up(xrdp_hang_up); /* SIGHUP */ g_sync_mutex = tc_mutex_create(); g_sync1_mutex = tc_mutex_create(); pid = g_getpid();