1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

Shell: Handle SIGCHLD after sending SIGCONT to job

This fixes `fg` and `bg` causing the shell to go into an infinite loop
of trying to `waitpid` until some current job changes state.

a.k.a. "Fix Shell backgrounding, yet again!" :P
This commit is contained in:
AnotherTest 2021-03-30 02:19:02 +04:30 committed by Andreas Kling
parent 50f5959996
commit 5d19509616
3 changed files with 12 additions and 3 deletions

View file

@ -111,7 +111,7 @@ int Shell::builtin_bg(int argc, const char** argv)
job->set_running_in_background(true);
job->set_should_announce_exit(true);
job->set_is_suspended(false);
job->set_shell_did_continue(true);
dbgln("Resuming {} ({})", job->pid(), job->cmd());
warnln("Resuming job {} - {}", job->job_id(), job->cmd().characters());
@ -396,7 +396,7 @@ int Shell::builtin_fg(int argc, const char** argv)
}
job->set_running_in_background(false);
job->set_is_suspended(false);
job->set_shell_did_continue(true);
dbgln("Resuming {} ({})", job->pid(), job->cmd());
warnln("Resuming job {} - {}", job->job_id(), job->cmd().characters());