From eacdab51aaa06bdf4b9c2517e0f552dbdeebb57a Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 1 Oct 1995 03:23:13 +0000 Subject: 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 --- sbin/nfsiod/nfsiod.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sbin/nfsiod') 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 -- cgit v1.1