commit: 378169e980db0bf73bd4e258c686622150be6383
parent 73771c877ce9eccdc0f5c60ae6ff6a933fa35181
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 18 Jun 2025 15:35:19 +0200
ignore SIGCHLD to avoid zombie processes
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/timer.c b/timer.c
@@ -78,6 +78,13 @@ main(int argc, char *argv[])
return 1;
}
+ errno = 0;
+ if(signal(SIGCHLD, SIG_IGN) == SIG_ERR)
+ {
+ fprintf(stderr, "timer: error: Failed setting to ignore SIGCHLD: %s\n", strerror(errno));
+ return 1;
+ }
+
struct sigevent timer_se;
timer_se.sigev_signo = SIGALRM;
timer_se.sigev_notify = SIGEV_SIGNAL;