aboutsummaryrefslogtreecommitdiff
path: root/chroot.c
diff options
context:
space:
mode:
Diffstat (limited to 'chroot.c')
-rw-r--r--chroot.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/chroot.c b/chroot.c
index f2d9b4d00..0440e46b9 100644
--- a/chroot.c
+++ b/chroot.c
@@ -48,17 +48,17 @@ int chroot_main(int argc, char **argv)
48 prog = *argv; 48 prog = *argv;
49 execvp(*argv, argv); 49 execvp(*argv, argv);
50 } else { 50 } else {
51#ifndef BB_SH 51#if defined(BB_SH) && defined BB_FEATURE_SH_STANDALONE_SHELL
52 prog = getenv("SHELL");
53 if (!prog)
54 prog = "/bin/sh";
55 execlp(prog, prog, NULL);
56#else
57 char shell[] = "/bin/sh"; 52 char shell[] = "/bin/sh";
58 char *shell_argv[2] = { shell, NULL }; 53 char *shell_argv[2] = { shell, NULL };
59 applet_name = shell; 54 applet_name = shell;
60 shell_main(1, shell_argv); 55 shell_main(1, shell_argv);
61 return EXIT_SUCCESS; 56 return EXIT_SUCCESS;
57#else
58 prog = getenv("SHELL");
59 if (!prog)
60 prog = "/bin/sh";
61 execlp(prog, prog, NULL);
62#endif 62#endif
63 } 63 }
64 perror_msg_and_die("cannot execute %s", prog); 64 perror_msg_and_die("cannot execute %s", prog);