]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/run/run.c
everywhere: port everything to sigprocmask_many() and friends
[thirdparty/systemd.git] / src / run / run.c
index 5b9f31c4aa527daf15f9ba8d0c55a272b9788d5c..99d960a664815ecfc2f5936a2904dd8d68b67336 100644 (file)
@@ -68,7 +68,7 @@ static void help(void) {
         printf("%s [OPTIONS...] {COMMAND} [ARGS...]\n\n"
                "Run the specified command in a transient scope or service or timer\n"
                "unit. If timer option is specified and unit is exist which is\n"
-               "specified with --unit option then command can be ommited.\n\n"
+               "specified with --unit option then command can be omitted.\n\n"
                "  -h --help                       Show this help\n"
                "     --version                    Show package version\n"
                "     --user                       Run as user unit\n"
@@ -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);