summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Dedrick <dan.dedrick@gmail.com>2014-07-29 15:31:23 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-03 01:32:08 -0400
commit23f25b1496c31ef4c20b8f3ee8328f7b1d5f3a54 (patch)
treebed793bf42f838da20fd479334a0d6ee8b0e531e /src
parent4212a3375e03fd12cb407b34cab59dbe4ed9f4eb (diff)
switch-root: umount the old root correctly
The unmount occurs after the pivot_root, so the path used to unmount should take into account the new root directory. This will allow the umount to actually succeed.
Diffstat (limited to 'src')
-rw-r--r--src/core/switch-root.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/switch-root.c b/src/core/switch-root.c
index f82243f8b1..f508cc2030 100644
--- a/src/core/switch-root.c
+++ b/src/core/switch-root.c
@@ -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;
}