diff options
author | Harald Hoyer <harald@redhat.com> | 2012-05-22 15:28:45 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-05-22 16:15:09 +0200 |
commit | b46178e5c2b95062b84257c0601c21c400089c09 (patch) | |
tree | 2e333af86c3f453d63688b0cfc0d4c9c394e7662 /src | |
parent | 7925c22a78d44b705c22a0d0972fb151d540697b (diff) | |
download | systemd-b46178e5c2b95062b84257c0601c21c400089c09.tar.gz |
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')
-rw-r--r-- | src/core/switch-root.c | 4 |
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; |