From 72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 15 Jun 2015 20:13:23 +0200 Subject: 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. --- src/run/run.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/run/run.c') 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); -- cgit v1.2.3-54-g00ecf