From: Harald Hoyer Date: Tue, 22 May 2012 13:28:45 +0000 (+0200) Subject: switch-root: do not use close old_root_fd after rm_rf_children() X-Git-Tag: v183~41 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b46178e5c2b95062b84257c0601c21c400089c09;p=systemd switch-root: do not use close old_root_fd after rm_rf_children() rm_rf_children() has already closed the fd with closedir(). --- diff --git a/src/core/switch-root.c b/src/core/switch-root.c index ed0a31e6..9832a520 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;