signal-util: make sigaction_many_ap a little more concise

There's no reason to duplicate the stop condition sig < 0, nor the sigaction()
call.
This commit is contained in:
Rasmus Villemoes 2020-10-30 10:27:55 +01:00
parent 6ced0770c7
commit bd8e699c27
1 changed files with 1 additions and 10 deletions

View File

@ -49,16 +49,7 @@ static int sigaction_many_ap(const struct sigaction *sa, int sig, va_list ap) {
int r = 0;
/* negative signal ends the list. 0 signal is skipped. */
if (sig < 0)
return 0;
if (sig > 0) {
if (sigaction(sig, sa, NULL) < 0)
r = -errno;
}
while ((sig = va_arg(ap, int)) >= 0) {
for (; sig >= 0; sig = va_arg(ap, int)) {
if (sig == 0)
continue;