chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7925c22
)
switch-root: do not use close old_root_fd after rm_rf_children()
author
Harald Hoyer
<harald@redhat.com>
Tue, 22 May 2012 13:28:45 +0000
(15:28 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 22 May 2012 14:15:09 +0000
(16:15 +0200)
rm_rf_children() has already closed the fd with closedir().
src/core/switch-root.c
patch
|
blob
|
history
diff --git
a/src/core/switch-root.c
b/src/core/switch-root.c
index ed0a31e6978b3649429f57f83710ed7dc621d52e..9832a520e4ac3f29d6ecfce0e85d181d826fcb3a 100644
(file)
--- 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;