kernel+launch: Always send SIGCHLD when a child exits
All checks were successful
Build and test / build (push) Successful in 1m44s
All checks were successful
Build and test / build (push) Successful in 1m44s
POSIX says so. I thought it was only when the parent wasn't actively waiting, to signal it, but it turns out it's always sent.
This commit is contained in:
parent
0ca6c5f814
commit
7761a8a41f
@ -48,7 +48,7 @@ void handle_ipc_message(os::IPC::ClientConnection& client, u8 id, void*)
|
|||||||
|
|
||||||
void sigchld_handler(int)
|
void sigchld_handler(int)
|
||||||
{
|
{
|
||||||
os::Process::wait(os::Process::ANY_CHILD, nullptr);
|
os::Process::wait(os::Process::ANY_CHILD, nullptr, WNOHANG);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> luna_main(int argc, char** argv)
|
Result<int> luna_main(int argc, char** argv)
|
||||||
|
@ -147,11 +147,8 @@ Result<SharedPtr<VFS::Inode>> Thread::resolve_atfile(int dirfd, const String& pa
|
|||||||
parent->wake_up();
|
parent->wake_up();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
while (parent->pending_signals.get(SIGCHLD - 1)) kernel_yield();
|
||||||
{
|
parent->send_signal(SIGCHLD);
|
||||||
while (parent->pending_signals.get(SIGCHLD - 1)) kernel_yield();
|
|
||||||
parent->send_signal(SIGCHLD);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
state = ThreadState::Exited;
|
state = ThreadState::Exited;
|
||||||
|
Loading…
Reference in New Issue
Block a user