use BB_EXECVP_or_die where appropriate

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-11-28 04:34:09 +01:00
parent 57542ebe4f
commit 1c31e9e82b
3 changed files with 3 additions and 6 deletions

View File

@ -441,8 +441,7 @@ int bootchartd_main(int argc UNUSED_PARAM, char **argv)
pid_t pid = xvfork(); pid_t pid = xvfork();
if (pid == 0) { /* child */ if (pid == 0) { /* child */
argv += 2; argv += 2;
execvp(argv[0], argv); BB_EXECVP_or_die(argv);
bb_perror_msg_and_die("can't execute '%s'", argv[0]);
} }
/* parent */ /* parent */
waitpid(pid, NULL, 0); waitpid(pid, NULL, 0);

View File

@ -268,8 +268,7 @@ static int doexec(char **proggie)
dup2(0, 1); dup2(0, 1);
/* dup2(0, 2); - do we *really* want this? NO! /* dup2(0, 2); - do we *really* want this? NO!
* exec'ed prog can do it yourself, if needed */ * exec'ed prog can do it yourself, if needed */
execvp(proggie[0], proggie); BB_EXECVP_or_die(proggie);
bb_perror_msg_and_die("can't execute '%s'", proggie[0]);
} }
/* connect_w_timeout: /* connect_w_timeout:

View File

@ -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'", bb_error_msg_and_die("can't set up security context '%s'",
context_str(con)); context_str(con));
execvp(argv[0], argv); BB_EXECVP_or_die(argv);
bb_perror_msg_and_die("can't execute '%s'", argv[0]);
} }