diff options
author | Jamey Sharp <jamey@thetovacompany.com> | 2008-04-22 16:21:11 -0700 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2008-04-24 11:22:49 +1000 |
commit | d5123a084bf2ba11e440b7dd238a7413b7e59956 (patch) | |
tree | fcc3807a46104534b55d5b5fef50d3ec2d6c894d /kexec | |
parent | eb5c1bab95722a56cc44beddd1eba8dd9470c82f (diff) |
Simplify initialization of argument list for `shutdown`.
Signed-off-by: Jamey Sharp <jamey@thetovacompany.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec')
-rw-r--r-- | kexec/kexec.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c index 2a71ace..3a1656a 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -704,13 +704,12 @@ int k_unload (unsigned long kexec_flags) */ static int my_shutdown(void) { - char *args[8]; - int i = 0; - - args[i++] = "shutdown"; - args[i++] = "-r"; - args[i++] = "now"; - args[i++] = NULL; + char *args[] = { + "shutdown", + "-r", + "now", + NULL + }; execv("/sbin/shutdown", args); execv("/etc/shutdown", args); |