[BusyBox] bug#1003: Fix for #1003

Matt Kraai kraai at alumni.carnegiemellon.edu
Fri Jul 7 15:33:31 UTC 2000


Howdy,

The function halt_signal in busybox/init.c is supposed to handle both
poweroff and halt.  It does this by determining whether it was notified
by SIGUSR1 (for halt) or SIGUSR2 (for poweroff).  However, when setting
up the signal handlers, it appears that SIGUSR2 is bound to
reboot_signal, so that the code to handle poweroff is never reached.
The attached patch changes it to use the correct signal handler.

Matt
-------------- next part --------------
Index: init.c
===================================================================
RCS file: /var/cvs/busybox/init.c,v
retrieving revision 1.88
diff -u -r1.88 init.c
--- init.c	2000/07/06 21:29:32	1.88
+++ init.c	2000/07/07 15:24:03
@@ -887,7 +887,7 @@
 	/* Set up sig handlers  -- be sure to
 	 * clear all of these in run() */
 	signal(SIGUSR1, halt_signal);
-	signal(SIGUSR2, reboot_signal);
+	signal(SIGUSR2, halt_signal);
 	signal(SIGINT, reboot_signal);
 	signal(SIGTERM, reboot_signal);
 #if defined BB_FEATURE_INIT_CHROOT
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20000707/ece3d5fd/attachment.pgp 


More information about the busybox mailing list