chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: make sure fd refers to regular file or directory when applying file attributes
[elogind.git]
/
src
/
shared
/
switch-root.c
diff --git
a/src/shared/switch-root.c
b/src/shared/switch-root.c
index 813641ad44da59b7c0969c89adc192a40623aceb..ae3839de162c9f4d254c04ce5fe9d274442460ed 100644
(file)
--- a/
src/shared/switch-root.c
+++ b/
src/shared/switch-root.c
@@
-29,10
+29,11
@@
#include "util.h"
#include "path-util.h"
#include "util.h"
#include "path-util.h"
-#include "switch-root.h"
#include "mkdir.h"
#include "mkdir.h"
+#include "rm-rf.h"
#include "base-filesystem.h"
#include "missing.h"
#include "base-filesystem.h"
#include "missing.h"
+#include "switch-root.h"
int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot, unsigned long mountflags) {
int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot, unsigned long mountflags) {
@@
-142,7
+143,7
@@
int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot,
if (fstat(old_root_fd, &rb) < 0)
log_warning_errno(errno, "Failed to stat old root directory, leaving: %m");
else {
if (fstat(old_root_fd, &rb) < 0)
log_warning_errno(errno, "Failed to stat old root directory, leaving: %m");
else {
-
rm_rf_children(old_root_fd, false, false
, &rb);
+
(void) rm_rf_children(old_root_fd, 0
, &rb);
old_root_fd = -1;
}
}
old_root_fd = -1;
}
}