From 3daf8df6ee835b9edcc068af33ae97910bb8d934 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 8 Apr 2005 12:51:20 +0000 Subject: Fix some Savannah bugs. Updates to docs (still need more work here) and NEWS file. New language. --- job.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'job.c') 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; } -- cgit v1.2.3