Browse Source

Fix raising signal from current thread outside of signal handler

K. Lange 1 year ago
parent
commit
897d11ed3b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      kernel/sys/signal.c

+ 5 - 1
kernel/sys/signal.c

@@ -228,7 +228,11 @@ int send_signal(pid_t process, uint32_t signal, int force_root) {
 
 	if (receiver == current_process) {
 		/* Forces us to be rescheduled and enter signal handler */
-		switch_next();
+		if (receiver->signal_kstack) {
+			switch_next();
+		} else {
+			switch_task(0);
+		}
 	}
 
 	return 0;