summaryrefslogtreecommitdiff
path: root/src/core/mount-setup.c
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-04-27 11:50:26 +0200
committerSven Eden <yamakuzure@gmx.net>2017-05-17 15:22:16 +0200
commit58172968ad2f9a350172f062cc459d070569916d (patch)
tree7215a592232f51801ba42fe79052f5c12003d058 /src/core/mount-setup.c
parent66ecc207e203db5434610395cd04c40ae8727b58 (diff)
Prep v229: Add missing fixes from upstream [2/6] src/core
Diffstat (limited to 'src/core/mount-setup.c')
-rw-r--r--src/core/mount-setup.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index f48d8a0ab..0467fe210 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
/***
This file is part of systemd.
@@ -40,8 +38,8 @@
#include "path-util.h"
//#include "set.h"
//#include "smack-util.h"
-//#include "strv.h"
#include "string-util.h"
+//#include "strv.h"
#include "user-util.h"
//#include "util.h"
#include "virt.h"
@@ -215,19 +213,14 @@ static int mount_one(const MountPoint *p, bool relabel) {
return 1;
}
-#if 0 /// UNNEEDED by elogind
-int mount_setup_early(void) {
+static int mount_points_setup(unsigned n, bool loaded_policy) {
unsigned i;
int r = 0;
- assert_cc(N_EARLY_MOUNT <= ELEMENTSOF(mount_table));
-
- /* Do a minimal mount of /proc and friends to enable the most
- * basic stuff, such as SELinux */
- for (i = 0; i < N_EARLY_MOUNT; i ++) {
+ for (i = 0; i < n; i ++) {
int j;
- j = mount_one(mount_table + i, false);
+ j = mount_one(mount_table + i, loaded_policy);
if (j != 0 && r >= 0)
r = j;
}
@@ -235,6 +228,15 @@ int mount_setup_early(void) {
return r;
}
+#if 0 /// UNNEEDED by elogind
+int mount_setup_early(void) {
+ assert_cc(N_EARLY_MOUNT <= ELEMENTSOF(mount_table));
+
+ /* Do a minimal mount of /proc and friends to enable the most
+ * basic stuff, such as SELinux */
+ return mount_points_setup(N_EARLY_MOUNT, false);
+}
+
int mount_cgroup_controllers(char ***join_controllers) {
_cleanup_set_free_free_ Set *controllers = NULL;
int r;
@@ -370,21 +372,13 @@ static int nftw_cb(
#endif // 0
int mount_setup(bool loaded_policy) {
- unsigned i;
int r = 0;
- for (i = 0; i < ELEMENTSOF(mount_table); i ++) {
- int j;
-
- j = mount_one(mount_table + i, loaded_policy);
- if (j != 0 && r >= 0)
- r = j;
- }
+ r = mount_points_setup(ELEMENTSOF(mount_table), loaded_policy);
if (r < 0)
return r;
-
#if 0 /// elogind does not control /, /dev, /run and /run/systemd/* are setup elsewhere.
#if defined(HAVE_SELINUX) || defined(HAVE_SMACK)
/* Nodes in devtmpfs and /run need to be manually updated for