Skip to contentSkip to conversation

signals: cleanup the usage of print_fatal_signal()

PATCH In review Oleg Nesterov 2 participants 2 messages Mar 10, 2008 – Mar 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 signals: cleanup the usage of print_fatal_signal()

Move the callsite of print_fatal_signal() down, under
"if (sig_kernel_coredump(signr))", so we don't need to check signr != SIGKILL.

We are only interested in the sig_kernel_coredump() signals anyway, and due to the previous changes we almost never can see other fatal signals here except SIGKILL.

kernel/signal.c renamed from kernel/signal.c~PFS_CLEANUP +3 -2
@@ -1766,9 +1766,10 @@ relock:
 		 * Anything else is fatal, maybe with a core dump.
 		 */
 		current->flags |= PF_SIGNALED;
-		if ((signr != SIGKILL) && print_fatal_signals)
-			print_fatal_signal(regs, signr);
+
 		if (sig_kernel_coredump(signr)) {
+			if (print_fatal_signals)
+				print_fatal_signal(regs, signr);
 			/*
 			 * If it was able to dump core, this kills all
 			 * other threads in the group and synchronizes with
#1 lore raw

Looks right to me. I'd prefer to see a comment before the added lines and a blank line after them, though.

Thanks,
Roland