aboutsummaryrefslogtreecommitdiffhomepage
path: root/proc.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-31 14:37:37 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-31 14:37:37 -0800
commit7356a0f6c86239de19195ae13c035544448eeca5 (patch)
treebf593000dab43d25cbce10620f93ce5a47ad2f00 /proc.cpp
parenta9787b769fce4327be5db4f361fb47208d4f79d1 (diff)
Clean up and rationalize error handling in parse_execution.cpp
Diffstat (limited to 'proc.cpp')
-rw-r--r--proc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/proc.cpp b/proc.cpp
index f6a20eb2..65e906ac 100644
--- a/proc.cpp
+++ b/proc.cpp
@@ -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;