*: make exec failure message more consistent

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-06-25 01:46:53 +02:00
parent 2b46fd49b1
commit 41ddd9f606
24 changed files with 40 additions and 40 deletions

View File

@@ -30,6 +30,6 @@ int chroot_main(int argc UNUSED_PARAM, char **argv)
argv[1] = (char *) "-i";
}
BB_EXECVP(*argv, argv);
bb_perror_msg_and_die("can't execute '%s'", *argv);
BB_EXECVP(argv[0], argv);
bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}

View File

@@ -76,11 +76,11 @@ int env_main(int argc UNUSED_PARAM, char **argv)
++argv;
}
if (*argv) {
BB_EXECVP(*argv, argv);
if (argv[0]) {
BB_EXECVP(argv[0], argv);
/* SUSv3-mandated exit codes. */
xfunc_error_retval = (errno == ENOENT) ? 127 : 126;
bb_simple_perror_msg_and_die(*argv);
bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
if (environ) { /* clearenv() may set environ == NULL! */

View File

@@ -47,9 +47,8 @@ int nice_main(int argc, char **argv)
}
}
BB_EXECVP(*argv, argv); /* Now exec the desired program. */
BB_EXECVP(argv[0], argv);
/* The exec failed... */
xfunc_error_retval = (errno == ENOENT) ? 127 : 126; /* SUSv3 */
bb_simple_perror_msg_and_die(*argv);
bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}

View File

@@ -75,6 +75,7 @@ int nohup_main(int argc UNUSED_PARAM, char **argv)
signal(SIGHUP, SIG_IGN);
BB_EXECVP(argv[1], argv+1);
bb_simple_perror_msg_and_die(argv[1]);
argv++;
BB_EXECVP(argv[0], argv);
bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}