diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-21 09:20:15 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-21 19:49:28 +0100 |
commit | cd2a429ed77fd5a94bc725ee587e028ee2e045dd (patch) | |
tree | 1e19eaa83df8da73d41fe0060f86422ba9b02812 /src/basic/async.c | |
parent | 9d6e839ed8b2fb5e611864f6ed5d278c5222c270 (diff) | |
download | systemd-cd2a429ed77fd5a94bc725ee587e028ee2e045dd.tar.gz |
tree-wide: use assert_se() for signal operations with constants
Continuation of a3ebe5eb620e49f0d24082876cafc7579261e64f:
in other places we sometimes use assert_se(), and sometimes normal error
handling. sigfillset and sigaddset can only fail if mask is NULL (which cannot
happen if we are passing in a reference), or if the signal number is invalid
(which really shouldn't happen when we are using a constant like SIGCHLD. If
SIGCHLD is invalid, we have a bigger problem). So let's simplify things and
always use assert_se() in those cases.
In sigset_add_many() we could conceivably pass an invalid signal, so let's keep
normal error handling here. The caller can do assert_se() around the
sigprocmask_many() call if appropriate.
'>= 0' is used for consistency with the rest of the codebase.
Diffstat (limited to 'src/basic/async.c')
-rw-r--r-- | src/basic/async.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/basic/async.c b/src/basic/async.c index 1c4b575b05..c45ca01847 100644 --- a/src/basic/async.c +++ b/src/basic/async.c @@ -32,10 +32,7 @@ int asynchronous_job(void* (*func)(void *p), void *arg) { goto finish; } - if (sigfillset(&ss) < 0) { - r = -errno; - goto finish; - } + assert_se(sigfillset(&ss) >= 0); /* Block all signals before forking off the thread, so that the new thread is started with all signals * blocked. This way the existence of the new thread won't affect signal handling in other threads. */ |