From e171f8886525cbaa48e40f7d5b31acb6db657fb2 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 21 Sep 2018 18:08:48 +0200 Subject: Remove pid fron cron serives, reap children in signal handler Signed-off-by: David Oberhollenzer --- crond/runjob.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crond/runjob.c') diff --git a/crond/runjob.c b/crond/runjob.c index 7650748..83c4278 100644 --- a/crond/runjob.c +++ b/crond/runjob.c @@ -33,10 +33,8 @@ int runjob(crontab_t *tab) return -1; } - if (pid != 0) { - tab->pid = pid; + if (pid != 0) return 0; - } /* XXX: inside the child process */ memset(&act, 0, sizeof(act)); @@ -44,6 +42,7 @@ int runjob(crontab_t *tab) sigaction(SIGINT, &act, NULL); sigaction(SIGTERM, &act, NULL); sigaction(SIGHUP, &act, NULL); + sigaction(SIGCHLD, &act, NULL); if (setup_tty(tab->ctty, tab->tty_truncate)) exit(EXIT_FAILURE); -- cgit v1.2.3