diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/async.c | 5 | ||||
-rw-r--r-- | src/basic/process-util.c | 14 | ||||
-rw-r--r-- | src/journal/journal-file.c | 3 | ||||
-rw-r--r-- | src/libsystemd/sd-resolve/sd-resolve.c | 3 |
4 files changed, 6 insertions, 19 deletions
diff --git a/src/basic/async.c b/src/basic/async.c index 1c4b575b0..c45ca0184 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. */ diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 3cfaceea8..448503409 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -1255,25 +1255,17 @@ int safe_fork_full( original_pid = getpid_cached(); if (flags & (FORK_RESET_SIGNALS|FORK_DEATHSIG)) { - /* We temporarily block all signals, so that the new child has them blocked initially. This way, we can * be sure that SIGTERMs are not lost we might send to the child. */ - if (sigfillset(&ss) < 0) - return log_full_errno(prio, errno, "Failed to reset signal set: %m"); - + assert_se(sigfillset(&ss) >= 0); block_signals = true; } else if (flags & FORK_WAIT) { - /* Let's block SIGCHLD at least, so that we can safely watch for the child process */ - if (sigemptyset(&ss) < 0) - return log_full_errno(prio, errno, "Failed to clear signal set: %m"); - - if (sigaddset(&ss, SIGCHLD) < 0) - return log_full_errno(prio, errno, "Failed to add SIGCHLD to signal set: %m"); - + assert_se(sigemptyset(&ss) >= 0); + assert_se(sigaddset(&ss, SIGCHLD) >= 0); block_signals = true; } diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 3e5733da6..56827f9f3 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -236,8 +236,7 @@ int journal_file_set_offline(JournalFile *f, bool wait) { sigset_t ss, saved_ss; int k; - if (sigfillset(&ss) < 0) - return -errno; + assert_se(sigfillset(&ss) >= 0); r = pthread_sigmask(SIG_BLOCK, &ss, &saved_ss); if (r > 0) diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c index 47986a4a6..21d783b8f 100644 --- a/src/libsystemd/sd-resolve/sd-resolve.c +++ b/src/libsystemd/sd-resolve/sd-resolve.c @@ -433,8 +433,7 @@ static int start_threads(sd_resolve *resolve, unsigned extra) { unsigned n; int r, k; - if (sigfillset(&ss) < 0) - return -errno; + assert_se(sigfillset(&ss) >= 0); /* No signals in forked off threads please. We set the mask before forking, so that the threads never exist * with a different mask than a fully blocked one */ |