summaryrefslogtreecommitdiff
path: root/Shell/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Shell/main.cpp')
-rw-r--r--Shell/main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Shell/main.cpp b/Shell/main.cpp
index 117c2e0592..edad94f0d1 100644
--- a/Shell/main.cpp
+++ b/Shell/main.cpp
@@ -488,7 +488,7 @@ static int run_command(const String& cmd)
for (int i = 0; i < children.size(); ++i) {
auto& child = children[i];
do {
- int rc = waitpid(child.pid, &wstatus, 0);
+ int rc = waitpid(child.pid, &wstatus, WEXITED | WSTOPPED);
if (rc < 0 && errno != EINTR) {
if (errno != ECHILD)
perror("waitpid");
@@ -499,6 +499,8 @@ static int run_command(const String& cmd)
printf("Shell: %s(%d) exited with status %d\n", child.name.characters(), child.pid, WEXITSTATUS(wstatus));
if (i == 0)
return_value = WEXITSTATUS(wstatus);
+ } else if (WIFSTOPPED(wstatus)) {
+ printf("Shell: %s(%d) stopped.\n", child.name.characters(), child.pid);
} else {
if (WIFSIGNALED(wstatus)) {
printf("Shell: %s(%d) exited due to signal '%s'\n", child.name.characters(), child.pid, strsignal(WTERMSIG(wstatus)));