kernel: Avoid processing unregistered signals for init

This commit is contained in:
apio 2023-07-10 19:48:46 +02:00
parent 15d6aae701
commit bdcb690a7a
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -117,6 +117,12 @@ void Thread::process_pending_signals(Registers* current_regs)
if (handler.sa_handler == SIG_DFL)
{
default_signal:
if (id == 1)
{
kwarnln("signal: init got a signal it has no handler for, ignoring");
return;
}
kinfoln("signal: using default behavior (handler=SIG_DFL) (terminating)");
// FIXME: Add different default handlers for different signals and add signal exit codes.
exit_and_signal_parent(255);