aboutsummaryrefslogtreecommitdiff
path: root/util-linux/switch_root.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/switch_root.c')
-rw-r--r--util-linux/switch_root.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index bd1e9d5ce..3a1741179 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -105,8 +105,9 @@ int switch_root_main(int argc, char **argv)
105 // Overmount / with newdir and chroot into it. The chdir is needed to 105 // Overmount / with newdir and chroot into it. The chdir is needed to
106 // recalculate "." and ".." links. 106 // recalculate "." and ".." links.
107 107
108 if (mount(".", "/", NULL, MS_MOVE, NULL) || chroot(".")) 108 if (mount(".", "/", NULL, MS_MOVE, NULL))
109 bb_error_msg_and_die("error moving root"); 109 bb_error_msg_and_die("error moving root");
110 xchroot(".");
110 xchdir("/"); 111 xchdir("/");
111 112
112 // If a new console specified, redirect stdin/stdout/stderr to that. 113 // If a new console specified, redirect stdin/stdout/stderr to that.