summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-08-12 06:29:21 +0430
committerAndreas Kling <kling@serenityos.org>2020-08-12 11:41:18 +0200
commitbe395aab9a123a88058e73871fc30899763b5e29 (patch)
tree0871694b07b0c9057a9b7fcaae2143c3b643c7f8
parent7aa5a2bc0f35c1874859a172f2a0d3708e969984 (diff)
downloadserenity-be395aab9a123a88058e73871fc30899763b5e29.zip
Shell: Do not assume that the job has exited after unblock in fg
-rw-r--r--Shell/Builtin.cpp5
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)