get rid of global "struct bb_applet *current_applet"

This commit is contained in:
Denis Vlasenko
2007-10-10 14:38:47 +00:00
parent 141750e388
commit 82d38dab91
7 changed files with 21 additions and 27 deletions

View File

@ -6470,10 +6470,8 @@ tryexec(char *cmd, char **argv, char **envp)
a = find_applet_by_name(cmd);
if (a) {
if (a->noexec) {
current_applet = a;
run_current_applet_and_exit(argv);
}
if (a->noexec)
run_appletstruct_and_exit(a, argv);
/* re-exec ourselves with the new arguments */
execve(bb_busybox_exec_path, argv, envp);
/* If they called chroot or otherwise made the binary no longer

View File

@ -1399,10 +1399,9 @@ static void pseudo_exec_argv(char **argv)
const struct bb_applet *a = find_applet_by_name(argv[0]);
if (a) {
if (a->noexec) {
current_applet = a;
debug_printf_exec("running applet '%s'\n", argv[0]);
// is it ok that run_current_applet_and_exit() does exit(), not _exit()?
run_current_applet_and_exit(argv);
// is it ok that run_appletstruct_and_exit() does exit(), not _exit()?
run_appletstruct_and_exit(a, argv);
}
/* re-exec ourselves with the new arguments */
debug_printf_exec("re-execing applet '%s'\n", argv[0]);