From 75e2f3fddb560b88552a93ca37d8049278665b2c Mon Sep 17 00:00:00 2001 From: Jon Steinhart Date: Wed, 20 Nov 2002 19:57:19 +0000 Subject: [PATCH] Fixed a bug in the waitpid version where it would return incorrectly if a child process was interrupted. --- sbr/pidwait.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbr/pidwait.c b/sbr/pidwait.c index a1555bb..1572bfe 100644 --- a/sbr/pidwait.c +++ b/sbr/pidwait.c @@ -11,6 +11,7 @@ #include #include +#include #include #ifdef HAVE_SYS_WAIT_H @@ -36,7 +37,8 @@ pidwait (pid_t id, int sigsok) } #ifdef HAVE_WAITPID - pid = waitpid(id, &status, 0); + while ((pid = waitpid(id, &status, 0)) == -1 && errno == EINTR) + ; #else while ((pid = wait(&status)) != -1 && pid != id) continue; -- 1.7.10.4