aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2025-08-11 01:14:43 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2025-08-11 01:17:02 +0200
commite660eab45867748ccf9dd8d5ddbdb5815381d4a7 (patch)
tree8585d8074d29431412a8b8cf60091dc612ba0481 /libbb
parentea2022efb32661e33ec43f3cd9f5cae8bc2b9547 (diff)
downloadbusybox-w32-e660eab45867748ccf9dd8d5ddbdb5815381d4a7.tar.gz
busybox-w32-e660eab45867748ccf9dd8d5ddbdb5815381d4a7.tar.bz2
busybox-w32-e660eab45867748ccf9dd8d5ddbdb5815381d4a7.zip
*: code shrink using sigprocmask2() where appropriate
function old new delta sig_unblock 41 43 +2 sig_block 41 40 -1 sigprocmask_allsigs 33 31 -2 wait_for_child_or_signal 202 193 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 2/-12) Total: -10 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/signals.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libbb/signals.c b/libbb/signals.c
index 413bdb31d..87d40bd24 100644
--- a/libbb/signals.c
+++ b/libbb/signals.c
@@ -24,13 +24,6 @@ int FAST_FUNC sigaction_set(int signum, const struct sigaction *act)
24 return sigaction(signum, act, NULL); 24 return sigaction(signum, act, NULL);
25} 25}
26 26
27int FAST_FUNC sigprocmask_allsigs(int how)
28{
29 sigset_t set;
30 sigfillset(&set);
31 return sigprocmask(how, &set, NULL);
32}
33
34int FAST_FUNC sigprocmask2(int how, sigset_t *set) 27int FAST_FUNC sigprocmask2(int how, sigset_t *set)
35{ 28{
36 // Grr... gcc 8.1.1: 29 // Grr... gcc 8.1.1:
@@ -41,6 +34,13 @@ int FAST_FUNC sigprocmask2(int how, sigset_t *set)
41 return sigprocmask(how, set, oset); 34 return sigprocmask(how, set, oset);
42} 35}
43 36
37int FAST_FUNC sigprocmask_allsigs(int how)
38{
39 sigset_t set;
40 sigfillset(&set);
41 return sigprocmask2(how, &set);
42}
43
44int FAST_FUNC sigblockall(sigset_t *set) 44int FAST_FUNC sigblockall(sigset_t *set)
45{ 45{
46#if 0 /* nope. set can be NULL */ 46#if 0 /* nope. set can be NULL */
@@ -94,7 +94,7 @@ void FAST_FUNC sig_block(int sig)
94 sigset_t ss; 94 sigset_t ss;
95 sigemptyset(&ss); 95 sigemptyset(&ss);
96 sigaddset(&ss, sig); 96 sigaddset(&ss, sig);
97 sigprocmask(SIG_BLOCK, &ss, NULL); 97 sigprocmask2(SIG_BLOCK, &ss);
98} 98}
99 99
100void FAST_FUNC sig_unblock(int sig) 100void FAST_FUNC sig_unblock(int sig)
@@ -102,7 +102,7 @@ void FAST_FUNC sig_unblock(int sig)
102 sigset_t ss; 102 sigset_t ss;
103 sigemptyset(&ss); 103 sigemptyset(&ss);
104 sigaddset(&ss, sig); 104 sigaddset(&ss, sig);
105 sigprocmask(SIG_UNBLOCK, &ss, NULL); 105 sigprocmask2(SIG_UNBLOCK, &ss);
106} 106}
107 107
108void FAST_FUNC wait_for_any_sig(void) 108void FAST_FUNC wait_for_any_sig(void)