mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 20:31:19 -03:00
Clean up and rationalize error handling in parse_execution.cpp
This commit is contained in:
6
proc.cpp
6
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;
|
||||
|
||||
Reference in New Issue
Block a user