diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-08-12 06:29:21 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-12 11:41:18 +0200 |
commit | be395aab9a123a88058e73871fc30899763b5e29 (patch) | |
tree | 0871694b07b0c9057a9b7fcaae2143c3b643c7f8 | |
parent | 7aa5a2bc0f35c1874859a172f2a0d3708e969984 (diff) | |
download | serenity-be395aab9a123a88058e73871fc30899763b5e29.zip |
Shell: Do not assume that the job has exited after unblock in fg
-rw-r--r-- | Shell/Builtin.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Shell/Builtin.cpp b/Shell/Builtin.cpp index e23588dbf0..cc5658ebdd 100644 --- a/Shell/Builtin.cpp +++ b/Shell/Builtin.cpp @@ -359,7 +359,10 @@ int Shell::builtin_fg(int argc, const char** argv) block_on_job(job); - return job->exit_code(); + if (job->exited()) + return job->exit_code(); + else + return 0; } int Shell::builtin_disown(int argc, const char** argv) |