diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-02-25 08:56:57 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-25 11:32:28 +0100 |
commit | 9c274488a9168f8284dc99882856ca79ce2aa132 (patch) | |
tree | 82f8a85d40d464998b08e9b0a8fb1c0719fa9f2e /src/systemctl/systemctl-switch-root.c | |
parent | Merge pull request #18018 from bluca/mount_images_overlay (diff) | |
download | systemd-9c274488a9168f8284dc99882856ca79ce2aa132.tar.xz systemd-9c274488a9168f8284dc99882856ca79ce2aa132.zip |
signal-util: make -1 termination of ignore_signals() argument list unnecessary
Clean up ignore_signals() + default_signals() + sigaction_many() a bit:
make it unnecessary to explicitly terminate the signal list with -1.
Merge all three calls into a single function that is just called with
slightly different parameters. And eliminate an unnecessary extra
iteration in its inner for() loop.
No change in behaviour.
Diffstat (limited to 'src/systemctl/systemctl-switch-root.c')
-rw-r--r-- | src/systemctl/systemctl-switch-root.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl-switch-root.c b/src/systemctl/systemctl-switch-root.c index 9ed40e6ec3..b801267974 100644 --- a/src/systemctl/systemctl-switch-root.c +++ b/src/systemctl/systemctl-switch-root.c @@ -60,7 +60,7 @@ int switch_root(int argc, char *argv[], void *userdata) { /* If we are slow to exit after the root switch, the new systemd instance will send us a signal to * terminate. Just ignore it and exit normally. This way the unit does not end up as failed. */ - r = ignore_signals(SIGTERM, -1); + r = ignore_signals(SIGTERM); if (r < 0) log_warning_errno(r, "Failed to change disposition of SIGTERM to ignore: %m"); @@ -68,7 +68,7 @@ int switch_root(int argc, char *argv[], void *userdata) { r = bus_call_method(bus, bus_systemd_mgr, "SwitchRoot", &error, NULL, "ss", root, init); if (r < 0) { - (void) default_signals(SIGTERM, -1); + (void) default_signals(SIGTERM); return log_error_errno(r, "Failed to switch root: %s", bus_error_message(&error, r)); } |