summaryrefslogtreecommitdiff
path: root/usr.sbin/cron
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-08-04 19:26:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-08-04 19:26:26 +0000
commit73d7e506331c4d94cf190afc8e971bfcaa8fcfee (patch)
tree2d7924022671484045c1371140b2db29a2a98ae8 /usr.sbin/cron
parentfb89d0cbe5641bec1cbdcc4473fbccfe84b2f3ed (diff)
save errno in sigchld handlers
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r--usr.sbin/cron/cron.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/cron/cron.c b/usr.sbin/cron/cron.c
index 0a9d67616c4..30e0c4f0909 100644
--- a/usr.sbin/cron/cron.c
+++ b/usr.sbin/cron/cron.c
@@ -16,7 +16,7 @@
*/
#if !defined(lint) && !defined(LINT)
-static char rcsid[] = "$Id: cron.c,v 1.2 1996/09/15 09:28:14 deraadt Exp $";
+static char rcsid[] = "$Id: cron.c,v 1.3 1997/08/04 19:26:08 deraadt Exp $";
#endif
@@ -252,6 +252,7 @@ cron_sleep() {
#ifdef USE_SIGCHLD
static void
sigchld_handler(x) {
+ int save_errno = errno;
WAIT_T waiter;
PID_T pid;
@@ -265,10 +266,12 @@ sigchld_handler(x) {
case -1:
Debug(DPROC,
("[%d] sigchld...no children\n", getpid()))
+ errno = save_errno;
return;
case 0:
Debug(DPROC,
("[%d] sigchld...no dead kids\n", getpid()))
+ errno = save_errno;
return;
default:
Debug(DPROC,
@@ -276,6 +279,7 @@ sigchld_handler(x) {
getpid(), pid, WEXITSTATUS(waiter)))
}
}
+ errno = save_errno;
}
#endif /*USE_SIGCHLD*/