summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl-compat-telinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemctl/systemctl-compat-telinit.c')
-rw-r--r--src/systemctl/systemctl-compat-telinit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/systemctl/systemctl-compat-telinit.c b/src/systemctl/systemctl-compat-telinit.c
index 1e771ef4a6..20325e5e1c 100644
--- a/src/systemctl/systemctl-compat-telinit.c
+++ b/src/systemctl/systemctl-compat-telinit.c
@@ -142,13 +142,14 @@ int start_with_fallback(void) {
}
int reload_with_fallback(void) {
- /* First, try systemd via D-Bus. */
- if (verb_daemon_reload(0, NULL, NULL) >= 0)
- return 0;
- /* Nothing else worked, so let's try signals */
assert(IN_SET(arg_action, ACTION_RELOAD, ACTION_REEXEC));
+ /* First, try systemd via D-Bus */
+ if (daemon_reload(arg_action, /* graceful= */ true) > 0)
+ return 0;
+
+ /* That didn't work, so let's try signals */
if (kill(1, arg_action == ACTION_RELOAD ? SIGHUP : SIGTERM) < 0)
return log_error_errno(errno, "kill() failed: %m");
@@ -157,7 +158,7 @@ int reload_with_fallback(void) {
int exec_telinit(char *argv[]) {
(void) rlimit_nofile_safe();
- execv(TELINIT, argv);
+ (void) execv(TELINIT, argv);
return log_error_errno(SYNTHETIC_ERRNO(EIO),
"Couldn't find an alternative telinit implementation to spawn.");