summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-06-15 20:13:23 +0200
committerLennart Poettering <lennart@poettering.net>2015-06-15 20:13:23 +0200
commit72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9 (patch)
tree09bd6f8db366a0a611de79dc08d88902d10f6a75 /src/run
parenta4c8a5995102144225439c0077bbda5325761986 (diff)
everywhere: port everything to sigprocmask_many() and friends
This ports a lot of manual code over to sigprocmask_many() and friends. Also, we now consistly check for sigprocmask() failures with assert_se(), since the call cannot realistically fail unless there's a programming error. Also encloses a few sd_event_add_signal() calls with (void) when we ignore the return values for it knowingly.
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/run/run.c b/src/run/run.c
index f18f77b55a..99d960a664 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -789,19 +789,16 @@ static int start_transient_service(
if (master >= 0) {
_cleanup_(pty_forward_freep) PTYForward *forward = NULL;
_cleanup_event_unref_ sd_event *event = NULL;
- sigset_t mask;
char last_char = 0;
r = sd_event_default(&event);
if (r < 0)
return log_error_errno(r, "Failed to get event loop: %m");
- assert_se(sigemptyset(&mask) == 0);
- sigset_add_many(&mask, SIGWINCH, SIGTERM, SIGINT, -1);
- assert_se(sigprocmask(SIG_BLOCK, &mask, NULL) == 0);
+ assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGWINCH, SIGTERM, SIGINT, -1) >= 0);
- sd_event_add_signal(event, NULL, SIGINT, NULL, NULL);
- sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL);
+ (void) sd_event_add_signal(event, NULL, SIGINT, NULL, NULL);
+ (void) sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL);
if (!arg_quiet)
log_info("Running as unit %s.\nPress ^] three times within 1s to disconnect TTY.", service);