mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
Shell: Don't assume that only the current shell may continue children
That can happen because of anyone sending the process a SIGCONT. Fixes an issue where continuing a process launched by the shell from the System Monitor would cause the shell to spin on waitpid().
This commit is contained in:
parent
459aa44f6b
commit
124ca30d49
Notes:
sideshowbarker
2024-07-18 08:54:21 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/124ca30d49e Pull-request: https://github.com/SerenityOS/serenity/pull/8811 Reviewed-by: https://github.com/ADKaster
|
@ -1759,10 +1759,11 @@ void Shell::notify_child_event()
|
|||
}
|
||||
if (child_pid == 0) {
|
||||
// If the child existed, but wasn't dead.
|
||||
if (job.is_suspended() && job.shell_did_continue()) {
|
||||
// The job was suspended, and we sent it a SIGCONT.
|
||||
if (job.is_suspended() || job.shell_did_continue()) {
|
||||
// The job was suspended, and someone sent it a SIGCONT.
|
||||
job.set_is_suspended(false);
|
||||
job.set_shell_did_continue(false);
|
||||
if (job.shell_did_continue())
|
||||
job.set_shell_did_continue(false);
|
||||
found_child = true;
|
||||
}
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue