summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-10-26 13:21:41 +0100
committerTom Gundersen <teg@jklm.no>2015-10-26 13:21:41 +0100
commitad1a44b23bbc909aa3f5876dadd482a9f6c18d5c (patch)
tree97fc092ae75eddafb746b58d2254c6af953f1e9e /src/core
parent0dec689b098cf62b948d43dc78bde859665056ec (diff)
parent4d0d3d41d21f34f28ee67b8b1952af88ada7abaf (diff)
Merge pull request #1676 from poettering/util-lib-2
split up util.[ch] into more pieces, and other stuff
Diffstat (limited to 'src/core')
-rw-r--r--src/core/automount.c1
-rw-r--r--src/core/bus-policy.c5
-rw-r--r--src/core/dbus-mount.c2
-rw-r--r--src/core/execute.c2
-rw-r--r--src/core/load-fragment-gperf.gperf.m42
-rw-r--r--src/core/machine-id-setup.c1
-rw-r--r--src/core/main.c1
-rw-r--r--src/core/manager.c1
-rw-r--r--src/core/mount.c12
-rw-r--r--src/core/mount.h2
-rw-r--r--src/core/namespace.c1
-rw-r--r--src/core/socket.c1
-rw-r--r--src/core/timer.c3
-rw-r--r--src/core/unit-printf.c3
-rw-r--r--src/core/unit.c3
15 files changed, 26 insertions, 14 deletions
diff --git a/src/core/automount.c b/src/core/automount.c
index c25038ca50..d362d6579d 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -36,6 +36,7 @@
#include "dbus-automount.h"
#include "fd-util.h"
#include "formats-util.h"
+#include "io-util.h"
#include "label.h"
#include "mkdir.h"
#include "mount.h"
diff --git a/src/core/bus-policy.c b/src/core/bus-policy.c
index a6a8fcd4d3..2490903a8c 100644
--- a/src/core/bus-policy.c
+++ b/src/core/bus-policy.c
@@ -19,10 +19,11 @@
#include <stdlib.h>
-#include "kdbus.h"
-#include "util.h"
#include "bus-kernel.h"
#include "bus-policy.h"
+#include "kdbus.h"
+#include "user-util.h"
+#include "util.h"
int bus_kernel_translate_access(BusPolicyAccess access) {
assert(access >= 0);
diff --git a/src/core/dbus-mount.c b/src/core/dbus-mount.c
index 318e81abd6..0c91850c52 100644
--- a/src/core/dbus-mount.c
+++ b/src/core/dbus-mount.c
@@ -118,7 +118,7 @@ const sd_bus_vtable bus_mount_vtable[] = {
SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(Mount, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("DirectoryMode", "u", bus_property_get_mode, offsetof(Mount, directory_mode), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("SloppyOptions", "b", bus_property_get_bool, offsetof(Mount, sloppy_options), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_PROPERTY("SmackFileSystemRoot", "s", NULL, offsetof(Mount, smack_fs_root), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("SmackFileSystemRootLabel", "s", NULL, offsetof(Mount, smack_fs_root_label), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Mount, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
BUS_EXEC_COMMAND_VTABLE("ExecMount", offsetof(Mount, exec_command[MOUNT_EXEC_MOUNT]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),
BUS_EXEC_COMMAND_VTABLE("ExecUnmount", offsetof(Mount, exec_command[MOUNT_EXEC_UNMOUNT]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),
diff --git a/src/core/execute.c b/src/core/execute.c
index 83ae3f6253..3f2607ff1a 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -69,6 +69,7 @@
#include "fd-util.h"
#include "fileio.h"
#include "formats-util.h"
+#include "io-util.h"
#include "ioprio.h"
#include "log.h"
#include "macro.h"
@@ -89,6 +90,7 @@
#include "strv.h"
#include "terminal-util.h"
#include "unit.h"
+#include "user-util.h"
#include "util.h"
#include "utmp-wtmp.h"
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index 507cfdde75..c3b48aec4c 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -319,7 +319,7 @@ Mount.Type, config_parse_string, 0,
Mount.TimeoutSec, config_parse_sec, 0, offsetof(Mount, timeout_usec)
Mount.DirectoryMode, config_parse_mode, 0, offsetof(Mount, directory_mode)
Mount.SloppyOptions, config_parse_bool, 0, offsetof(Mount, sloppy_options)
-Mount.SmackFileSystemRoot, config_parse_string, 0, offsetof(Mount, smack_fs_root)
+Mount.SmackFileSystemRootLabel, config_parse_string, 0, offsetof(Mount, smack_fs_root_label)
EXEC_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl
CGROUP_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl
KILL_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl
diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
index f59bf56c73..c72892b343 100644
--- a/src/core/machine-id-setup.c
+++ b/src/core/machine-id-setup.c
@@ -31,6 +31,7 @@
#include "fd-util.h"
#include "fileio.h"
+#include "io-util.h"
#include "log.h"
#include "machine-id-setup.h"
#include "macro.h"
diff --git a/src/core/main.c b/src/core/main.c
index 68ec730406..b0ca6fa10e 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -76,6 +76,7 @@
#include "strv.h"
#include "switch-root.h"
#include "terminal-util.h"
+#include "user-util.h"
#include "virt.h"
#include "watchdog.h"
diff --git a/src/core/manager.c b/src/core/manager.c
index 400c66977b..287676ff27 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -55,6 +55,7 @@
#include "exit-status.h"
#include "fd-util.h"
#include "hashmap.h"
+#include "io-util.h"
#include "locale-setup.h"
#include "log.h"
#include "macro.h"
diff --git a/src/core/mount.c b/src/core/mount.c
index 47dd680b93..ebdb3503e9 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -206,7 +206,7 @@ static void mount_done(Unit *u) {
assert(m);
m->where = mfree(m->where);
- m->smack_fs_root = mfree(m->smack_fs_root);
+ m->smack_fs_root_label = mfree(m->smack_fs_root_label);
mount_parameters_done(&m->parameters_proc_self_mountinfo);
mount_parameters_done(&m->parameters_fragment);
@@ -672,7 +672,7 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) {
"%sFrom /proc/self/mountinfo: %s\n"
"%sFrom fragment: %s\n"
"%sDirectoryMode: %04o\n"
- "%sSmackFileSystemRoot: %s\n",
+ "%sSmackFileSystemRootLabel: %s\n",
prefix, mount_state_to_string(m->state),
prefix, mount_result_to_string(m->result),
prefix, m->where,
@@ -682,7 +682,7 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) {
prefix, yes_no(m->from_proc_self_mountinfo),
prefix, yes_no(m->from_fragment),
prefix, m->directory_mode,
- prefix, strna(m->smack_fs_root));
+ prefix, strna(m->smack_fs_root_label));
if (m->control_pid > 0)
fprintf(f,
@@ -868,12 +868,12 @@ static int mount_get_opts(Mount *m, char **_opts) {
if (r < 0)
return r;
- if (mac_smack_use() && m->smack_fs_root) {
+ if (mac_smack_use() && m->smack_fs_root_label) {
if (!isempty(o)) {
- opts = strjoin(o, ",", "smackfsroot=", m->smack_fs_root, NULL);
+ opts = strjoin(o, ",", "smackfsroot=", m->smack_fs_root_label, NULL);
free(o);
} else
- opts = strjoin("smackfsroot=", m->smack_fs_root, NULL);
+ opts = strjoin("smackfsroot=", m->smack_fs_root_label, NULL);
if (!opts)
return -ENOMEM;
diff --git a/src/core/mount.h b/src/core/mount.h
index 4e28810f6c..b344b5aa13 100644
--- a/src/core/mount.h
+++ b/src/core/mount.h
@@ -71,7 +71,7 @@ struct Mount {
bool reset_cpu_usage:1;
bool sloppy_options;
- char *smack_fs_root;
+ char *smack_fs_root_label;
MountResult result;
MountResult reload_result;
diff --git a/src/core/namespace.c b/src/core/namespace.c
index 470f384056..4d11d54bfe 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -36,6 +36,7 @@
#include "namespace.h"
#include "path-util.h"
#include "selinux-util.h"
+#include "socket-util.h"
#include "string-util.h"
#include "strv.h"
#include "util.h"
diff --git a/src/core/socket.c b/src/core/socket.c
index e2085dac1c..7f401025ed 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -54,6 +54,7 @@
#include "unit-name.h"
#include "unit-printf.h"
#include "unit.h"
+#include "user-util.h"
static const UnitActiveState state_translation_table[_SOCKET_STATE_MAX] = {
[SOCKET_DEAD] = UNIT_INACTIVE,
diff --git a/src/core/timer.c b/src/core/timer.c
index 4548a4fa52..908d45ac73 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -26,9 +26,10 @@
#include "dbus-timer.h"
#include "special.h"
#include "string-util.h"
+#include "timer.h"
#include "unit-name.h"
#include "unit.h"
-#include "timer.h"
+#include "user-util.h"
static const UnitActiveState state_translation_table[_TIMER_STATE_MAX] = {
[TIMER_DEAD] = UNIT_INACTIVE,
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c
index 5b62f2d65c..4a5c7efdb0 100644
--- a/src/core/unit-printf.c
+++ b/src/core/unit-printf.c
@@ -26,8 +26,9 @@
#include "string-util.h"
#include "strv.h"
#include "unit-name.h"
-#include "unit.h"
#include "unit-printf.h"
+#include "unit.h"
+#include "user-util.h"
static int specifier_prefix_and_instance(char specifier, void *data, void *userdata, char **ret) {
Unit *u = userdata;
diff --git a/src/core/unit.c b/src/core/unit.c
index a054cc79b0..572b1c1b78 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -51,8 +51,9 @@
#include "string-util.h"
#include "strv.h"
#include "unit-name.h"
-#include "virt.h"
#include "unit.h"
+#include "user-util.h"
+#include "virt.h"
const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
[UNIT_SERVICE] = &service_vtable,