//bb_error_msg("VT's sid %d", tcgetsid(0));
//bb_error_msg("VT's pgrp %d", tcgetpgrp(0));
BB_EXECVP(argv[0], argv);
- bb_perror_msg_and_die("exec %s", argv[0]);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
}
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]);
}
++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! */
}
}
- 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]);
}
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]);
}
}
#endif
execvp(startas, argv);
- bb_perror_msg_and_die("can't start %s", startas);
+ bb_perror_msg_and_die("can't execute '%s'", startas);
}
freecon(current_sid);
#endif
execv(shell, (char **) args);
- bb_perror_msg_and_die("can't run '%s'", shell);
+ bb_perror_msg_and_die("can't execute '%s'", shell);
}
* "we have (already) re-execed, don't do it again" flag */
argv[0][0] |= 0x80;
execv(bb_busybox_exec_path, argv);
- bb_perror_msg_and_die("exec %s", bb_busybox_exec_path);
+ bb_perror_msg_and_die("can't execute '%s'", bb_busybox_exec_path);
}
pid_t FAST_FUNC fork_or_rexec(char **argv)
if (!G.helper_pid) {
// child: try to execute connection helper
// NB: SIGCHLD & SIGALRM revert to SIG_DFL on exec
- BB_EXECVP(*argv, (char **)argv);
- _exit(127);
+ BB_EXECVP(argv[0], (char **)argv);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
// parent
xsetenv("CHARSET", charset);
xsetenv("ENCODING", encoding);
xsetenv("FILENAME", filename);
- BB_EXECVP(*argv, argv);
- _exit(EXIT_FAILURE);
+ BB_EXECVP(argv[0], argv);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
// parent dumps to fd[1]
close(fd[0]);
if (sched_setscheduler(pid, policy, &sp) < 0)
bb_perror_msg_and_die("can't %cet pid %d's policy", 's', pid);
- if (!*argv) /* "-p <priority> <pid> [...]" */
+ if (!argv[0]) /* "-p <priority> <pid> [...]" */
goto print_rt_info;
- BB_EXECVP(*argv, argv);
- bb_simple_perror_msg_and_die(*argv);
+ BB_EXECVP(argv[0], argv);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
pri |= (ioclass << IOPRIO_CLASS_SHIFT);
if (ioprio_set(IOPRIO_WHO_PROCESS, pid, pri) == -1)
bb_perror_msg_and_die("ioprio_%cet", 's');
- if (*argv) {
- BB_EXECVP(*argv, argv);
- bb_simple_perror_msg_and_die(*argv);
+ if (argv[0]) {
+ BB_EXECVP(argv[0], argv);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
}
setsid();
}
- 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]);
}
if (sched_setaffinity(pid, sizeof(mask), &mask))
bb_perror_msg_and_die("can't %cet pid %d's affinity", 's', pid);
- if (!*argv) /* "-p <aff> <pid> [...ignored...]" */
+ if (!argv[0]) /* "-p <aff> <pid> [...ignored...]" */
goto print_aff; /* print new affinity and exit */
- BB_EXECVP(*argv, argv);
- bb_simple_perror_msg_and_die(*argv);
+ BB_EXECVP(argv[0], argv);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
versus merely warnings if the cast is left off. */
BB_EXECVP(cmd[0], cmd);
xfunc_error_retval = (errno == ENOENT ? 127 : 126);
- bb_error_msg_and_die("can't run '%s'", cmd[0]);
+ bb_perror_msg_and_die("can't execute '%s'", cmd[0]);
}
/* Have signals kill the child but not self (if possible). */
argv[1] = sv2;
#endif
BB_EXECVP(argv[0], argv);
- bb_perror_msg_and_die("exec '%s'", argv[0]);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
* in the current directory */
execv(argv[0], argv);
if (verbose)
- bb_perror_msg("exec %s", argv[0]);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
error_execing_cgi:
/* send to stdout
* (we are CGI here, our stdout is pumped to the net) */
xmove_fd(infd.rd, 0);
xmove_fd(outfd.wr, 1);
BB_EXECVP(command, argv);
- _exit(127);
+ bb_perror_msg_and_die("can't execute '%s'", command);
}
/* parent */
close(infd.rd);
sigaction_set(SIGPIPE, &saved_pipe_handler);
restore_sigmask(&omask);
BB_EXECVP(sep->se_program, sep->se_argv);
- bb_perror_msg("exec %s", sep->se_program);
+ bb_perror_msg_and_die("can't execute '%s'", sep->se_program);
do_exit1:
/* eat packet in udp case */
if (sep->se_socktype != SOCK_STREAM)
/* 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("exec");
+ bb_perror_msg_and_die("can't execute '%s'", proggie[0]);
}
/* connect_w_timeout:
#else
BB_EXECVP(argv[0], argv);
#endif
- bb_perror_msg_and_die("exec '%s'", argv[0]);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
/*
// this call reopens stdio fds to "/dev/null"
// (no daemonization is done)
bb_daemonize_or_rexec(DAEMON_DEVNULL_STDIO | DAEMON_ONLY_SANITIZE, NULL);
- BB_EXECVP(*argv, argv);
- exit(127);
+ BB_EXECVP(argv[0], argv);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
// validate input.
close(STDERR_FILENO);
BB_EXECVP(argv[0], argv);
- bb_perror_msg_and_die("exec %s", argv[0]);
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}
context_str(con));
execvp(argv[0], argv);
-
bb_perror_msg_and_die("can't execute '%s'", argv[0]);
}