diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-12-31 14:37:37 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-12-31 14:37:37 -0800 |
commit | 7356a0f6c86239de19195ae13c035544448eeca5 (patch) | |
tree | bf593000dab43d25cbce10620f93ce5a47ad2f00 /proc.cpp | |
parent | a9787b769fce4327be5db4f361fb47208d4f79d1 (diff) |
Clean up and rationalize error handling in parse_execution.cpp
Diffstat (limited to 'proc.cpp')
-rw-r--r-- | proc.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |