summaryrefslogtreecommitdiff
path: root/src/core/switch-root.c
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2012-05-22 15:28:45 +0200
committerLennart Poettering <lennart@poettering.net>2012-05-22 16:15:09 +0200
commitb46178e5c2b95062b84257c0601c21c400089c09 (patch)
tree2e333af86c3f453d63688b0cfc0d4c9c394e7662 /src/core/switch-root.c
parent7925c22a78d44b705c22a0d0972fb151d540697b (diff)
switch-root: do not use close old_root_fd after rm_rf_children()
rm_rf_children() has already closed the fd with closedir().
Diffstat (limited to 'src/core/switch-root.c')
-rw-r--r--src/core/switch-root.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/switch-root.c b/src/core/switch-root.c
index ed0a31e697..9832a520e4 100644
--- a/src/core/switch-root.c
+++ b/src/core/switch-root.c
@@ -111,8 +111,10 @@ int switch_root(const char *new_root) {
if (fstat(old_root_fd, &rb) < 0)
log_warning("Failed to stat old root directory, leaving: %m");
- else
+ else {
rm_rf_children(old_root_fd, false, false, &rb);
+ old_root_fd = -1;
+ }
}
r = 0;