Compare commits

...

2 Commits

Author SHA1 Message Date
7761a8a41f
kernel+launch: Always send SIGCHLD when a child exits
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.
2024-12-04 22:44:16 +01:00
0ca6c5f814
taskbar: Remove sigchld handler
We are not launching child processes from taskbar anymore, that job is left to /bin/launch.
2024-12-04 22:42:59 +01:00
3 changed files with 3 additions and 12 deletions

View File

@ -19,11 +19,6 @@ static constexpr ui::Color TASKBAR_COLOR = ui::Color::from_rgb(83, 83, 83);
static OwnedPtr<os::IPC::Client> launcher_client;
void sigchld_handler(int)
{
wait(nullptr);
}
void sigquit_handler(int)
{
// Reload the taskbar by exec-ing the executable, resetting everything.
@ -118,7 +113,6 @@ Result<int> luna_main(int, char**)
ui::App app;
TRY(app.init("/tmp/wsys.sock"));
TRY(os::EventLoop::the().register_signal_handler(SIGCHLD, sigchld_handler));
TRY(os::EventLoop::the().register_signal_handler(SIGQUIT, sigquit_handler));
launcher_client = TRY(os::IPC::Client::connect("/tmp/launch.sock", false));

View File

@ -48,7 +48,7 @@ void handle_ipc_message(os::IPC::ClientConnection& client, u8 id, void*)
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)

View File

@ -147,11 +147,8 @@ Result<SharedPtr<VFS::Inode>> Thread::resolve_atfile(int dirfd, const String& pa
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;