systemctl: move telinit execcing out of parse_argv()

With this change, parse_argv() does parsing, without any real actions.
Fully untested ;)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-02-08 12:17:24 +01:00
parent 54d04cd1e7
commit ea71b4604b
4 changed files with 18 additions and 5 deletions
+10
View File
@@ -1,9 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include <unistd.h>
#include "alloc-util.h"
#include "pretty-print.h"
#include "rlimit-util.h"
#include "systemctl-compat-telinit.h"
#include "systemctl-daemon-reload.h"
#include "systemctl-start-unit.h"
@@ -150,3 +152,11 @@ int reload_with_fallback(void) {
return 0;
}
int exec_telinit(char *argv[]) {
(void) rlimit_nofile_safe();
execv(TELINIT, argv);
return log_error_errno(SYNTHETIC_ERRNO(EIO),
"Couldn't find an alternative telinit implementation to spawn.");
}