Clean up and rationalize error handling in parse_execution.cpp

This commit is contained in:
ridiculousfish
2013-12-31 14:37:37 -08:00
parent a9787b769f
commit 7356a0f6c8
5 changed files with 342 additions and 280 deletions

View File

@@ -638,6 +638,9 @@ int job_reap(bool interactive)
static int locked = 0;
locked++;
/* Preserve the exit status */
const int saved_status = proc_get_last_status();
/*
job_read may fire an event handler, we do not want to call
@@ -753,6 +756,9 @@ int job_reap(bool interactive)
if (found)
fflush(stdout);
/* Restore the exit status. */
proc_set_last_status(saved_status);
locked = 0;
return found;