From 819606fcbde7d1eeb352aaadae6d6d5eb82a12ce Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sun, 23 May 2021 20:38:16 +0900 Subject: [PATCH] Fix signal delivery... --- kernel/sys/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sys/signal.c b/kernel/sys/signal.c index 98023a3..0b639a9 100644 --- a/kernel/sys/signal.c +++ b/kernel/sys/signal.c @@ -206,7 +206,7 @@ int send_signal(pid_t process, int signal, int force_root) { if (!(receiver->flags & PROC_FLAG_SUSPENDED)) { return -EINVAL; } else { - __sync_and_and_fetch(&this_core->current_process->flags, ~(PROC_FLAG_SUSPENDED)); + __sync_and_and_fetch(&receiver->flags, ~(PROC_FLAG_SUSPENDED)); receiver->status = 0; } } @@ -223,7 +223,7 @@ int send_signal(pid_t process, int signal, int force_root) { } else { spin_unlock(receiver->sched_lock); } - if (!process_is_ready(receiver) && !(receiver->flags & PROC_FLAG_RUNNING)) { + if (!process_is_ready(receiver) || receiver == this_core->current_process) { make_process_ready(receiver); }