diff --git a/src/tint.c b/src/tint.c index 7160f87..f78fb40 100644 --- a/src/tint.c +++ b/src/tint.c @@ -326,13 +326,16 @@ void init(int argc, char *argv[]) } // Set signal handlers signal_pending = 0; - struct sigaction sa = {.sa_handler = signal_handler}; + struct sigaction sa_chld = {.sa_handler = SIG_DFL, .sa_flags = SA_NOCLDWAIT}; + sigaction(SIGCHLD, &sa_chld, 0); + + struct sigaction sa = {.sa_handler = signal_handler}; sigaction(SIGUSR1, &sa, 0); sigaction(SIGINT, &sa, 0); sigaction(SIGTERM, &sa, 0); sigaction(SIGHUP, &sa, 0); - sigaction(SIGCHLD, &sa_chld, 0); + #ifdef BACKTRACE_ON_SIGNAL struct sigaction sa_crash = {.sa_handler = crash_handler}; sigaction(SIGSEGV, &sa_crash, 0);