From: Jon Steinhart Date: Wed, 20 Nov 2002 19:57:19 +0000 (+0000) Subject: Fixed a bug in the waitpid version where it would return incorrectly if a X-Git-Tag: RELEASE_1_2~109 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=75e2f3fddb560b88552a93ca37d8049278665b2c;p=mmh Fixed a bug in the waitpid version where it would return incorrectly if a child process was interrupted. --- 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;