[PATCH 8/9] Simplify initialization of argument list for `shutdown`.

Jamey Sharp jamey at thetovacompany.com
Tue Apr 22 19:21:11 EDT 2008


Signed-off-by: Jamey Sharp <jamey at thetovacompany.com>
---
Admittedly gratuitous, but I couldn't stand it. :-)

 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);
-- 
1.5.4.1




More information about the kexec mailing list