summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoian Bonev <bbonev@ipacct.com>2011-11-03 23:16:20 +0530
committerBoian Bonev <bbonev@ipacct.com>2011-11-03 23:16:20 +0530
commita987cb67dcda1986b66434244afca24b50bff15d (patch)
treea2ce6d8d75fc21592ee1ee12724d4c55fc4f9513
parentab1d9657ca42ab7576473bcd6726ba5e8ab2fcbe (diff)
downloadMAC-Telnet-a987cb67dcda1986b66434244afca24b50bff15d.tar.gz
MAC-Telnet-a987cb67dcda1986b66434244afca24b50bff15d.zip
handle signals in foreground mode as well
-rw-r--r--mactelnetd.c5
1 files changed, 5 insertions, 0 deletions
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);