[git commit master 1/1] use BB_EXECVP_or_die where appropriate

Denys Vlasenko vda.linux at googlemail.com
Sun Nov 28 03:34:09 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=1c31e9e82b12bdceeec4f8e07955984e20ee6b7e
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 init/bootchartd.c      |    3 +--
 networking/nc_bloaty.c |    3 +--
 selinux/runcon.c       |    3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/init/bootchartd.c b/init/bootchartd.c
index 5a1b3e8..ac3f261 100644
--- a/init/bootchartd.c
+++ b/init/bootchartd.c
@@ -441,8 +441,7 @@ int bootchartd_main(int argc UNUSED_PARAM, char **argv)
 		pid_t pid = xvfork();
 		if (pid == 0) { /* child */
 			argv += 2;
-			execvp(argv[0], argv);
-			bb_perror_msg_and_die("can't execute '%s'", argv[0]);
+			BB_EXECVP_or_die(argv);
 		}
 		/* parent */
 		waitpid(pid, NULL, 0);
diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c
index 3c622e5..e98a5dd 100644
--- a/networking/nc_bloaty.c
+++ b/networking/nc_bloaty.c
@@ -268,8 +268,7 @@ static int doexec(char **proggie)
 	dup2(0, 1);
 	/* dup2(0, 2); - do we *really* want this? NO!
 	 * exec'ed prog can do it yourself, if needed */
-	execvp(proggie[0], proggie);
-	bb_perror_msg_and_die("can't execute '%s'", proggie[0]);
+	BB_EXECVP_or_die(proggie);
 }
 
 /* connect_w_timeout:
diff --git a/selinux/runcon.c b/selinux/runcon.c
index b70a5e3..54349b2 100644
--- a/selinux/runcon.c
+++ b/selinux/runcon.c
@@ -132,6 +132,5 @@ int runcon_main(int argc UNUSED_PARAM, char **argv)
 		bb_error_msg_and_die("can't set up security context '%s'",
 				     context_str(con));
 
-	execvp(argv[0], argv);
-	bb_perror_msg_and_die("can't execute '%s'", argv[0]);
+	BB_EXECVP_or_die(argv);
 }
-- 
1.7.2.2



More information about the busybox-cvs mailing list