aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-09-27 13:20:34 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2012-09-27 13:20:34 +0200
commitc4f2d997a40025657de9a9cbf3c963b080d702fb (patch)
treea62dfab676c5a0f780e5e915e4fa3da0b60bda46
parent73a19908975948154d1a07c3550592059238e9ef (diff)
downloadbusybox-w32-c4f2d997a40025657de9a9cbf3c963b080d702fb.tar.gz
busybox-w32-c4f2d997a40025657de9a9cbf3c963b080d702fb.tar.bz2
busybox-w32-c4f2d997a40025657de9a9cbf3c963b080d702fb.zip
libbb: correctness/size tweaks in signal-related helpers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/signals.c6
-rw-r--r--procps/top.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/libbb/signals.c b/libbb/signals.c
index cdc37b1ef..56512473a 100644
--- a/libbb/signals.c
+++ b/libbb/signals.c
@@ -39,7 +39,7 @@ void FAST_FUNC bb_signals(int sigs, void (*f)(int))
39 39
40 while (sigs) { 40 while (sigs) {
41 if (sigs & bit) { 41 if (sigs & bit) {
42 sigs &= ~bit; 42 sigs -= bit;
43 signal(sig_no, f); 43 signal(sig_no, f);
44 } 44 }
45 sig_no++; 45 sig_no++;
@@ -60,7 +60,7 @@ void FAST_FUNC bb_signals_recursive_norestart(int sigs, void (*f)(int))
60 60
61 while (sigs) { 61 while (sigs) {
62 if (sigs & bit) { 62 if (sigs & bit) {
63 sigs &= ~bit; 63 sigs -= bit;
64 sigaction_set(sig_no, &sa); 64 sigaction_set(sig_no, &sa);
65 } 65 }
66 sig_no++; 66 sig_no++;
@@ -97,7 +97,7 @@ void FAST_FUNC kill_myself_with_sig(int sig)
97 signal(sig, SIG_DFL); 97 signal(sig, SIG_DFL);
98 sig_unblock(sig); 98 sig_unblock(sig);
99 raise(sig); 99 raise(sig);
100 _exit(EXIT_FAILURE); /* Should not reach it */ 100 _exit(sig | 128); /* Should not reach it */
101} 101}
102 102
103void FAST_FUNC signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) 103void FAST_FUNC signal_SA_RESTART_empty_mask(int sig, void (*handler)(int))
diff --git a/procps/top.c b/procps/top.c
index 1977fcafc..b08444a76 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -727,7 +727,7 @@ static void reset_term(void)
727 } 727 }
728} 728}
729 729
730static void sig_catcher(int sig UNUSED_PARAM) 730static void sig_catcher(int sig)
731{ 731{
732 reset_term(); 732 reset_term();
733 kill_myself_with_sig(sig); 733 kill_myself_with_sig(sig);