lpd: spool mode added by Vladimir
[platform/upstream/busybox.git] / util-linux / switch_root.c
index bd1e9d5..3a17411 100644 (file)
@@ -105,8 +105,9 @@ int switch_root_main(int argc, char **argv)
        // Overmount / with newdir and chroot into it.  The chdir is needed to
        // recalculate "." and ".." links.
 
-       if (mount(".", "/", NULL, MS_MOVE, NULL) || chroot("."))
+       if (mount(".", "/", NULL, MS_MOVE, NULL))
                bb_error_msg_and_die("error moving root");
+       xchroot(".");
        xchdir("/");
 
        // If a new console specified, redirect stdin/stdout/stderr to that.