mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
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:
parent
6ced0770c7
commit
bd8e699c27
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user