[systemd-commits] src/core

Harald Hoyer harald at kemper.freedesktop.org
Wed Aug 13 07:47:49 PDT 2014


 src/core/switch-root.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5caeb7d6854e02321e0e00588e17412b161ef176
Author: Harald Hoyer <harald at redhat.com>
Date:   Wed Aug 13 16:45:53 2014 +0200

    switch-root: not only mkdir the parents but the target dir
    
    switch-root would only mkdir the parents of the mount move directories.
    
    With this patch, the mount move target directory is created to make
    switch-root to an empty root directory work.

diff --git a/src/core/switch-root.c b/src/core/switch-root.c
index f508cc2..0ea61db 100644
--- a/src/core/switch-root.c
+++ b/src/core/switch-root.c
@@ -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) {



More information about the systemd-commits mailing list