chiark / gitweb /
core: add support for a configurable system-wide start-up timeout
[elogind.git] / src / core / switch-root.c
index f82243f8b1a6ab9616ac0d194f58bbc71174f972..0ea61dbb290f8413fba8cc0f28990bde4ca76966 100644 (file)
@@ -84,7 +84,7 @@ int switch_root(const char *new_root) {
                 snprintf(new_mount, sizeof(new_mount), "%s%s", new_root, i);
                 char_array_0(new_mount);
 
-                mkdir_parents(new_mount, 0755);
+                mkdir_p(new_mount, 0755);
 
                 if ((stat(new_mount, &sb) < 0) ||
                     sb.st_dev != new_root_stat.st_dev) {
@@ -129,8 +129,8 @@ int switch_root(const char *new_root) {
 
                 /* Immediately get rid of the old root. Since we are
                  * running off it we need to do this lazily. */
-                if (umount2(temporary_old_root, MNT_DETACH) < 0) {
-                        log_error("Failed to umount old root dir %s: %m", temporary_old_root);
+                if (umount2("/mnt", MNT_DETACH) < 0) {
+                        log_error("Failed to umount old root dir /mnt: %m");
                         return -errno;
                 }