summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-04-08 12:51:20 +0000
committerPaul Smith <psmith@gnu.org>2005-04-08 12:51:20 +0000
commit3daf8df6ee835b9edcc068af33ae97910bb8d934 (patch)
treea90131bc43bd817abd1850df4ade8d58339d3334 /job.c
parent4923580e3a5b3d9e7ff29ef1e5a5339cc7619a4b (diff)
downloadgunmake-3daf8df6ee835b9edcc068af33ae97910bb8d934.tar.gz
Fix some Savannah bugs.
Updates to docs (still need more work here) and NEWS file. New language.
Diffstat (limited to 'job.c')
-rw-r--r--job.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/job.c b/job.c
index 28d1e6b..48048d1 100644
--- a/job.c
+++ b/job.c
@@ -525,6 +525,8 @@ child_handler (int sig UNUSED)
extern int shell_function_pid, shell_function_completed;
+static int reap_lock = 0;
+
/* Reap all dead children, storing the returned status and the new command
state (`cs_finished') in the `file' member of the `struct child' for the
dead child, and removing the child from the chain. In addition, if BLOCK
@@ -545,6 +547,9 @@ reap_children (int block, int err)
# define REAP_MORE dead_children
#endif
+ if (reap_lock)
+ fatal (NILF, _("INTERNAL: reap_children invoked while reap_lock set."));
+
/* As long as:
We have at least one child outstanding OR a shell function in progress,
@@ -1470,6 +1475,7 @@ start_waiting_job (struct child *c)
}
/* Start the first command; reap_children will run later command lines. */
+ reap_lock = 1;
start_job_command (c);
switch (f->command_state)
@@ -1500,6 +1506,8 @@ start_waiting_job (struct child *c)
break;
}
+ reap_lock = 0;
+
return 1;
}