[git commit] libbb: correctness/size tweaks in signal-related helpers

Denys Vlasenko vda.linux at googlemail.com
Thu Sep 27 11:20:34 UTC 2012


commit: http://git.busybox.net/busybox/commit/?id=c4f2d997a40025657de9a9cbf3c963b080d702fb
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/signals.c |    6 +++---
 procps/top.c    |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libbb/signals.c b/libbb/signals.c
index cdc37b1..5651247 100644
--- a/libbb/signals.c
+++ b/libbb/signals.c
@@ -39,7 +39,7 @@ void FAST_FUNC bb_signals(int sigs, void (*f)(int))
 
 	while (sigs) {
 		if (sigs & bit) {
-			sigs &= ~bit;
+			sigs -= bit;
 			signal(sig_no, f);
 		}
 		sig_no++;
@@ -60,7 +60,7 @@ void FAST_FUNC bb_signals_recursive_norestart(int sigs, void (*f)(int))
 
 	while (sigs) {
 		if (sigs & bit) {
-			sigs &= ~bit;
+			sigs -= bit;
 			sigaction_set(sig_no, &sa);
 		}
 		sig_no++;
@@ -97,7 +97,7 @@ void FAST_FUNC kill_myself_with_sig(int sig)
 	signal(sig, SIG_DFL);
 	sig_unblock(sig);
 	raise(sig);
-	_exit(EXIT_FAILURE); /* Should not reach it */
+	_exit(sig | 128); /* Should not reach it */
 }
 
 void FAST_FUNC signal_SA_RESTART_empty_mask(int sig, void (*handler)(int))
diff --git a/procps/top.c b/procps/top.c
index 1977fca..b08444a 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -727,7 +727,7 @@ static void reset_term(void)
 	}
 }
 
-static void sig_catcher(int sig UNUSED_PARAM)
+static void sig_catcher(int sig)
 {
 	reset_term();
 	kill_myself_with_sig(sig);


More information about the busybox-cvs mailing list