From e2dd25d3cf2f10c0cff0d37d05f58b81344db68b Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 4 Oct 2005 01:27:34 +0000 Subject: Bug #2027: Treat SIGTERM like SIGINT in xinit. (Andreas Luik) --- xinit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xinit.c') diff --git a/xinit.c b/xinit.c index 5ced5cd..956d78a 100644 --- a/xinit.c +++ b/xinit.c @@ -215,6 +215,7 @@ sigCatch(int sig) #ifdef X_NOT_POSIX char buf[1024]; + signal(SIGTERM, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); @@ -440,6 +441,7 @@ main(int argc, char *argv[], char *envp[]) signal(SIGCHLD, SIG_DFL); /* Insurance */ #endif #ifdef X_NOT_POSIX + signal(SIGTERM, sigCatch); signal(SIGQUIT, sigCatch); signal(SIGINT, sigCatch); signal(SIGHUP, sigCatch); @@ -451,6 +453,7 @@ main(int argc, char *argv[], char *envp[]) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; /* do not set SA_RESTART */ + sigaction(SIGTERM, &sa, NULL); sigaction(SIGQUIT, &sa, NULL); sigaction(SIGINT, &sa, NULL); sigaction(SIGHUP, &sa, NULL); @@ -468,6 +471,7 @@ main(int argc, char *argv[], char *envp[]) ) pid = wait(NULL); } + signal(SIGTERM, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); -- cgit v1.2.3