← Commit list

e660eab45

Denys Vlasenko
Denys Vlasenko
2025-08-11
SUCCESS Duration: 155s

Subject

*: code shrink using sigprocmask2() where appropriate

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/signals.c+9 -9
@@ -24,13 +24,6 @@ int FAST_FUNC sigaction_set(int signum, const struct sigaction *act)
return sigaction(signum, act, NULL);
}
-int FAST_FUNC sigprocmask_allsigs(int how)
-{
- sigset_t set;
- sigfillset(&set);
- return sigprocmask(how, &set, NULL);
-}
-
int FAST_FUNC sigprocmask2(int how, sigset_t *set)
{
// Grr... gcc 8.1.1:
@@ -41,6 +34,13 @@ int FAST_FUNC sigprocmask2(int how, sigset_t *set)
return sigprocmask(how, set, oset);
}
+int FAST_FUNC sigprocmask_allsigs(int how)
+{
+ sigset_t set;
+ sigfillset(&set);
+ return sigprocmask2(how, &set);
+}
+
int FAST_FUNC sigblockall(sigset_t *set)
{
#if 0 /* nope. set can be NULL */
@@ -94,7 +94,7 @@ void FAST_FUNC sig_block(int sig)
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss, sig);
- sigprocmask(SIG_BLOCK, &ss, NULL);
+ sigprocmask2(SIG_BLOCK, &ss);
}
void FAST_FUNC sig_unblock(int sig)
@@ -102,7 +102,7 @@ void FAST_FUNC sig_unblock(int sig)
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss, sig);
- sigprocmask(SIG_UNBLOCK, &ss, NULL);
+ sigprocmask2(SIG_UNBLOCK, &ss);
}
void FAST_FUNC wait_for_any_sig(void)
shell/hush.c+3 -3
@@ -12177,7 +12177,7 @@ static int wait_for_child_or_signal(struct pipe *waitfor_pipe, pid_t waitfor_pid
debug_printf_exec("job_exited_or_stopped:%d\n", rcode);
if (rcode >= 0) {
ret = rcode;
- sigprocmask(SIG_SETMASK, &oldset, NULL);
+ sigprocmask2(SIG_SETMASK, &oldset);
break;
}
}
@@ -12195,7 +12195,7 @@ static int wait_for_child_or_signal(struct pipe *waitfor_pipe, pid_t waitfor_pid
ret = 127;
}
# endif
- sigprocmask(SIG_SETMASK, &oldset, NULL);
+ sigprocmask2(SIG_SETMASK, &oldset);
break;
}
/* Wait for SIGCHLD or any other signal */
@@ -12213,7 +12213,7 @@ static int wait_for_child_or_signal(struct pipe *waitfor_pipe, pid_t waitfor_pid
* making "wait" commands in SCRIPT block forever.
*/
restore:
- sigprocmask(SIG_SETMASK, &oldset, NULL);
+ sigprocmask2(SIG_SETMASK, &oldset);
check_sig:
/* So, did we get a signal? */
sig = check_and_run_traps();