summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-08-11 19:32:02 +0000
committerRoland McGrath <roland@redhat.com>1993-08-11 19:32:02 +0000
commit1bafe5ed816ba1da59994ae14c36e26e30c42a14 (patch)
tree2f53f7fda6e7c858b3b1b29ac6f34120744e9bd1 /job.c
parent869ec1b8775bc5ec86c39470e086e702873b3444 (diff)
downloadgunmake-1bafe5ed816ba1da59994ae14c36e26e30c42a14.tar.gz
Formerly job.c.~106~
Diffstat (limited to 'job.c')
-rw-r--r--job.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/job.c b/job.c
index 88892a4..fb0f22e 100644
--- a/job.c
+++ b/job.c
@@ -204,7 +204,7 @@ reap_children (block, err)
int exit_code, exit_sig, coredump;
register struct child *lastc, *c;
int child_failed;
- int any_remote;
+ int any_remote, any_local;
if (err && dead_children == 0)
{
@@ -229,9 +229,11 @@ reap_children (block, err)
--dead_children;
any_remote = 0;
+ any_local = shell_function_pid != -1;
for (c = children; c != 0; c = c->next)
{
any_remote |= c->remote;
+ any_locate != ! c->remote;
if (debug_flag)
printf ("Live child 0x%08lx PID %d%s\n",
(unsigned long int) c,
@@ -256,12 +258,17 @@ reap_children (block, err)
{
/* No remote children. Check for local children. */
+ if (any_local)
+ {
#ifdef WAIT_NOHANG
- if (!block)
- pid = WAIT_NOHANG (&status);
- else
+ if (!block)
+ pid = WAIT_NOHANG (&status);
+ else
#endif
- pid = wait (&status);
+ pid = wait (&status);
+ }
+ else
+ pid = 0;
if (pid < 0)
{