From 6458ec20b574edf7170fda61c51ccd3c6e73937f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 19 May 2015 20:32:44 +0200 Subject: core,nspawn: unify code that moves the root dir --- src/core/namespace.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/core/namespace.c') diff --git a/src/core/namespace.c b/src/core/namespace.c index 5b782798c8..c0c64fd706 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -125,22 +125,6 @@ static void drop_duplicates(BindMount *m, unsigned *n) { *n = t - m; } -static int mount_move_root(const char *path) { - if (chdir(path) < 0) - return -errno; - - if (mount(path, "/", NULL, MS_MOVE, NULL) < 0) - return -errno; - - if (chroot(".") < 0) - return -errno; - - if (chdir("/") < 0) - return -errno; - - return 0; -} - static int mount_dev(BindMount *m) { static const char devnodes[] = "/dev/null\0" -- cgit v1.2.3-54-g00ecf