summaryrefslogtreecommitdiffstats
path: root/src/shutdown
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-05-15 17:30:24 +0200
committerMike Yuan <me@yhndnzj.com>2024-05-21 05:39:28 +0200
commit2e4da5e08cb62a75c1027f8012dfbd5e45ba4ec2 (patch)
tree2028c15cc09d07f8ccf99458e519d6361c025ce5 /src/shutdown
parentshutdown: downgrade log level of ignored errors to warning (diff)
downloadsystemd-2e4da5e08cb62a75c1027f8012dfbd5e45ba4ec2.tar.xz
systemd-2e4da5e08cb62a75c1027f8012dfbd5e45ba4ec2.zip
shutdown: use execl where appropriate
Diffstat (limited to 'src/shutdown')
-rw-r--r--src/shutdown/shutdown.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
index 115a4b6eb7..49f986f8c8 100644
--- a/src/shutdown/shutdown.c
+++ b/src/shutdown/shutdown.c
@@ -624,13 +624,9 @@ int main(int argc, char *argv[]) {
r = safe_fork("(sd-kexec)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_LOG|FORK_WAIT, NULL);
if (r == 0) {
- const char * const args[] = {
- KEXEC, "-e", NULL
- };
-
/* Child */
- execv(args[0], (char * const *) args);
+ (void) execl(KEXEC, KEXEC, "-e", NULL);
log_debug_errno(errno, "Failed to execute '" KEXEC "' binary, proceeding with reboot(RB_KEXEC): %m");
/* execv failed (kexec binary missing?), so try simply reboot(RB_KEXEC) */