switch-root: do not use close old_root_fd after rm_rf_children()

rm_rf_children() has already closed the fd with closedir().
This commit is contained in:
Harald Hoyer 2012-05-22 15:28:45 +02:00 committed by Lennart Poettering
parent 7925c22a78
commit b46178e5c2

View file

@ -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;