terminated quickly would cause an endless loop.
;-) Nobody noticed by now, so I guess few people used it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@98892
13f79535-47bb-0310-9956-
ffa450edef68
* Initialize BS2000 user environment
*/
{
- pid_t pid;
+ pid_t pid, reaped;
int status;
switch (pid = ufork(target_uname))
case 0: /* Child */
break;
default: /* Father */
- while (pid != waitpid(pid, &status, 0))
+ while (pid != (reaped = waitpid(pid, &status, 0))
+ && (reaped != -1 || errno != ECHILD))
;
/* @@@ FIXME: should we deal with STOP signals as well? */
if (WIFSIGNALED(status)) {