summaryrefslogtreecommitdiff
path: root/sbin
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 /sbin
parentfb89d0cbe5641bec1cbdcc4473fbccfe84b2f3ed (diff)
save errno in sigchld handlers
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount_portal/mount_portal.c6
-rw-r--r--sbin/nfsd/nfsd.c7
-rw-r--r--sbin/nfsiod/nfsiod.c4
3 files changed, 12 insertions, 5 deletions
diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c
index 55911432ffa..a6f38b3a81c 100644
--- a/sbin/mount_portal/mount_portal.c
+++ b/sbin/mount_portal/mount_portal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount_portal.c,v 1.11 1997/06/25 18:25:47 kstailey Exp $ */
+/* $OpenBSD: mount_portal.c,v 1.12 1997/08/04 19:25:19 deraadt Exp $ */
/* $NetBSD: mount_portal.c,v 1.8 1996/04/13 01:31:54 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)mount_portal.c 8.6 (Berkeley) 4/26/95";
#else
-static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.11 1997/06/25 18:25:47 kstailey Exp $";
+static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.12 1997/08/04 19:25:19 deraadt Exp $";
#endif
#endif /* not lint */
@@ -87,12 +87,14 @@ static void
sigchld(sig)
int sig;
{
+ int save_errno = errno;
pid_t pid;
while ((pid = waitpid((pid_t) -1, NULL, WNOHANG)) > 0)
;
if (pid < 0 && errno != ECHILD)
syslog(LOG_WARNING, "waitpid: %m");
+ errno = save_errno;
}
static void
diff --git a/sbin/nfsd/nfsd.c b/sbin/nfsd/nfsd.c
index 554bcc1214e..186f2d2f086 100644
--- a/sbin/nfsd/nfsd.c
+++ b/sbin/nfsd/nfsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsd.c,v 1.6 1997/06/29 11:10:32 provos Exp $ */
+/* $OpenBSD: nfsd.c,v 1.7 1997/08/04 19:25:21 deraadt Exp $ */
/* $NetBSD: nfsd.c,v 1.19 1996/02/18 23:18:56 mycroft Exp $ */
/*
@@ -624,6 +624,9 @@ void
reapchild(signo)
int signo;
{
+ int save_errno = errno;
- while (wait3(NULL, WNOHANG, NULL) > 0);
+ while (wait3(NULL, WNOHANG, NULL) > 0)
+ ;
+ errno = save_errno;
}
diff --git a/sbin/nfsiod/nfsiod.c b/sbin/nfsiod/nfsiod.c
index ee596a50641..f3d4d7bb692 100644
--- a/sbin/nfsiod/nfsiod.c
+++ b/sbin/nfsiod/nfsiod.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsiod.c,v 1.4 1997/01/15 23:41:35 millert Exp $ */
+/* $OpenBSD: nfsiod.c,v 1.5 1997/08/04 19:25:22 deraadt Exp $ */
/* $NetBSD: nfsiod.c,v 1.12 1996/02/20 16:06:55 fvdl Exp $ */
/*
@@ -165,9 +165,11 @@ void
reapchild(signo)
int signo;
{
+ int save_errno = errno;
while (wait3(NULL, WNOHANG, NULL) > 0)
;
+ errno = save_errno;
}
void