aboutsummaryrefslogtreecommitdiff
path: root/chroot.c
diff options
context:
space:
mode:
Diffstat (limited to 'chroot.c')
-rw-r--r--chroot.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chroot.c b/chroot.c
index 9b1a5a82d..e8ce53973 100644
--- a/chroot.c
+++ b/chroot.c
@@ -47,10 +47,15 @@ int chroot_main(int argc, char **argv)
47 prog = *argv; 47 prog = *argv;
48 execvp(*argv, argv); 48 execvp(*argv, argv);
49 } else { 49 } else {
50#ifndef BB_SH
50 prog = getenv("SHELL"); 51 prog = getenv("SHELL");
51 if (!prog) 52 if (!prog)
52 prog = "/bin/sh"; 53 prog = "/bin/sh";
53 execlp(prog, prog, NULL); 54 execlp(prog, prog, NULL);
55#else
56 shell_main(argc, argv);
57 exit (0);
58#endif
54 } 59 }
55 fatalError("cannot execute %s: %s\n", prog, strerror(errno)); 60 fatalError("cannot execute %s: %s\n", prog, strerror(errno));
56 61