Shell: If a command process is stopped, print the stop signal to stderr

This commit is contained in:
Andreas Kling 2020-01-27 20:48:42 +01:00
commit 7454926765
Notes: sideshowbarker 2024-07-19 09:46:29 +09:00

View file

@ -817,7 +817,7 @@ static int run_command(const String& cmd)
if (i == 0)
return_value = WEXITSTATUS(wstatus);
} else if (WIFSTOPPED(wstatus)) {
printf("Shell: %s(%d) stopped.\n", child.name.characters(), child.pid);
fprintf(stderr, "Shell: %s(%d) %s\n", child.name.characters(), child.pid, strsignal(WSTOPSIG(wstatus)));
} else {
if (WIFSIGNALED(wstatus)) {
printf("Shell: %s(%d) exited due to signal '%s'\n", child.name.characters(), child.pid, strsignal(WTERMSIG(wstatus)));