[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kexec
Subject:    [PATCH 8/9] Simplify initialization of argument list for `shutdown`.
From:       jamey () thetovacompany ! com (Jamey Sharp)
Date:       2008-04-22 23:21:11
Message-ID: 1208906472-18465-9-git-send-email-jamey () thetovacompany ! com
[Download RAW message or body]

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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic