diff options
author | peter <peter@FreeBSD.org> | 1995-10-01 03:23:13 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-10-01 03:23:13 +0000 |
commit | eacdab51aaa06bdf4b9c2517e0f552dbdeebb57a (patch) | |
tree | 0199fe2ef6d799c981f443696ca1f2cdac8e1314 | |
parent | a924a14c485ae721652c62480df0212a1e70f93e (diff) | |
download | FreeBSD-src-eacdab51aaa06bdf4b9c2517e0f552dbdeebb57a.zip FreeBSD-src-eacdab51aaa06bdf4b9c2517e0f552dbdeebb57a.tar.gz |
Catch the case where the children can die too soon causing wait3()
to return ECHILD, which causes the while loop to run forever.
(eg: when accidently running nfsiod on a slow system with a kernel
without NFS support...)
Obtained from: NetBSD; Frank van den Linden <frank@struis.fwi.uva.nl>
-rw-r--r-- | sbin/nfsiod/nfsiod.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/nfsiod/nfsiod.c b/sbin/nfsiod/nfsiod.c index 0a6985f..3100671 100644 --- a/sbin/nfsiod/nfsiod.c +++ b/sbin/nfsiod/nfsiod.c @@ -172,7 +172,9 @@ reapchild(signo) int signo; { - while (wait3(NULL, WNOHANG, NULL)); + while (wait3(NULL, WNOHANG, NULL) > 0) { + /* nothing */ + }; } void |