From a987cb67dcda1986b66434244afca24b50bff15d Mon Sep 17 00:00:00 2001 From: Boian Bonev Date: Thu, 3 Nov 2011 23:16:20 +0530 Subject: handle signals in foreground mode as well --- mactelnetd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mactelnetd.c b/mactelnetd.c index aef5027..ba1aad6 100644 --- a/mactelnetd.c +++ b/mactelnetd.c @@ -922,6 +922,11 @@ int main (int argc, char **argv) { if (!foreground) { daemonize(); + } else { + signal(SIGCHLD,SIG_IGN); + signal(SIGTSTP,SIG_IGN); + signal(SIGTTOU,SIG_IGN); + signal(SIGTTIN,SIG_IGN); } openlog("mactelnetd", LOG_PID, LOG_DAEMON); -- cgit v1.2.3