X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmount-setup.c;h=f30adabbf07137ddb49d4f1f4a1fa4b8e25fcd1e;hb=da4b83e77bc603745cf4a365d7f013301ef7fa89;hp=4713187e6c3c1b787000b4c42489f4f97b0ee149;hpb=eeeefb47fde1f010e14c9f0a6104bba011ce9b20;p=elogind.git
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 4713187e6..f30adabbf 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -19,28 +19,32 @@
along with systemd; If not, see .
***/
-#include
#include
+#include
#include
+#include
#include
-#include
-#include "mount-setup.h"
-//#include "dev-setup.h"
+#include "alloc-util.h"
//#include "bus-util.h"
+#include "cgroup-util.h"
+//#include "dev-setup.h"
+//#include "efivars.h"
+#include "label.h"
//#include "log.h"
#include "macro.h"
-//#include "util.h"
-#include "label.h"
-//#include "set.h"
-//#include "strv.h"
+//#include "missing.h"
#include "mkdir.h"
+#include "mount-setup.h"
+#include "mount-util.h"
#include "path-util.h"
-//#include "missing.h"
-#include "virt.h"
-//#include "efivars.h"
+//#include "set.h"
//#include "smack-util.h"
-#include "cgroup-util.h"
+//#include "strv.h"
+#include "string-util.h"
+#include "user-util.h"
+//#include "util.h"
+#include "virt.h"
typedef enum MountMode {
MNT_NONE = 0,
@@ -181,7 +185,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
return 0;
/* Skip securityfs in a container */
- if (!(p->mode & MNT_IN_CONTAINER) && detect_container(NULL) > 0)
+ if (!(p->mode & MNT_IN_CONTAINER) && detect_container() > 0)
return 0;
/* The access mode here doesn't really matter too much, since
@@ -227,7 +231,7 @@ int mount_setup_early(void) {
int j;
j = mount_one(mount_table + i, false);
- if (r == 0)
+ if (j != 0 && r >= 0)
r = j;
}
@@ -371,7 +375,7 @@ int mount_setup(bool loaded_policy) {
int j;
j = mount_one(mount_table + i, loaded_policy);
- if (r == 0)
+ if (j != 0 && r >= 0)
r = j;
}
@@ -412,7 +416,7 @@ int mount_setup(bool loaded_policy) {
* nspawn and the container tools work out of the box. If
* specific setups need other settings they can reset the
* propagation mode to private if needed. */
- if (detect_container(NULL) <= 0)
+ if (detect_container() <= 0)
if (mount(NULL, "/", NULL, MS_REC|MS_SHARED, NULL) < 0)
log_warning_errno(errno, "Failed to set up the root directory for shared mount propagation: %m");