From: Mike Yuan Date: Wed, 15 May 2024 15:30:24 +0000 (+0800) Subject: shutdown: use execl where appropriate X-Git-Tag: v257-rc1~1196^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e4da5e08cb62a75c1027f8012dfbd5e45ba4ec2;p=thirdparty%2Fsystemd.git shutdown: use execl where appropriate --- diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index 115a4b6eb7a..49f986f8c8a 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) */