mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
Shell: Avoid messing with sigaction while waiting for a child
This commit is contained in:
parent
70a213a6ec
commit
d5e9213683
Notes:
sideshowbarker
2024-07-19 06:05:31 +09:00
Author: https://github.com/alimpfard
Commit: d5e9213683
Pull-request: https://github.com/SerenityOS/serenity/pull/2398
Reviewed-by: https://github.com/awesomekling
3 changed files with 10 additions and 11 deletions
|
@ -58,7 +58,7 @@ void FileDescriptionCollector::add(int fd)
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
Core::EventLoop loop;
|
||||
|
||||
|
||||
signal(SIGINT, [](int) {
|
||||
editor->interrupted();
|
||||
});
|
||||
|
@ -74,6 +74,8 @@ int main(int argc, char** argv)
|
|||
signal(SIGCHLD, [](int) {
|
||||
auto& jobs = s_shell->jobs;
|
||||
for (auto& job : jobs) {
|
||||
if (s_shell->is_waiting_for(job.value->pid()))
|
||||
continue;
|
||||
int wstatus = 0;
|
||||
auto child_pid = waitpid(job.value->pid(), &wstatus, WNOHANG);
|
||||
if (child_pid == job.value->pid()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue