summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-25 13:14:12 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-25 13:19:18 +0100
commit3ffd4af22052963e7a29431721ee204e634bea75 (patch)
treefe60142dfddd37cfc02b7a135542107e772b36c3 /src/libsystemd/sd-bus
parent04c0136989b7eb896bfb0fb176e11233d69e1453 (diff)
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them over.
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r--src/libsystemd/sd-bus/bus-container.c7
-rw-r--r--src/libsystemd/sd-bus/bus-creds.c1
-rw-r--r--src/libsystemd/sd-bus/bus-introspect.c3
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c3
-rw-r--r--src/libsystemd/sd-bus/bus-match.c3
-rw-r--r--src/libsystemd/sd-bus/bus-message.c3
-rw-r--r--src/libsystemd/sd-bus/bus-socket.c3
-rw-r--r--src/libsystemd/sd-bus/bus-track.c3
-rw-r--r--src/libsystemd/sd-bus/busctl.c1
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-benchmark.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-chat.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-kernel-bloom.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-kernel.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-marshal.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-zero-copy.c1
16 files changed, 25 insertions, 9 deletions
diff --git a/src/libsystemd/sd-bus/bus-container.c b/src/libsystemd/sd-bus/bus-container.c
index 435ec92d6f..589a90bbff 100644
--- a/src/libsystemd/sd-bus/bus-container.c
+++ b/src/libsystemd/sd-bus/bus-container.c
@@ -22,11 +22,12 @@
#include <unistd.h>
#include <fcntl.h>
-#include "util.h"
-#include "process-util.h"
+#include "bus-container.h"
#include "bus-internal.h"
#include "bus-socket.h"
-#include "bus-container.h"
+#include "fd-util.h"
+#include "process-util.h"
+#include "util.h"
int bus_container_connect_socket(sd_bus *b) {
_cleanup_close_pair_ int pair[2] = { -1, -1 };
diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c
index 92978da09c..d7bff784b8 100644
--- a/src/libsystemd/sd-bus/bus-creds.c
+++ b/src/libsystemd/sd-bus/bus-creds.c
@@ -29,6 +29,7 @@
#include "bus-util.h"
#include "capability.h"
#include "cgroup-util.h"
+#include "fd-util.h"
#include "fileio.h"
#include "formats-util.h"
#include "process-util.h"
diff --git a/src/libsystemd/sd-bus/bus-introspect.c b/src/libsystemd/sd-bus/bus-introspect.c
index 7ad5474439..f5a8885332 100644
--- a/src/libsystemd/sd-bus/bus-introspect.c
+++ b/src/libsystemd/sd-bus/bus-introspect.c
@@ -20,11 +20,12 @@
***/
#include "bus-internal.h"
+#include "bus-introspect.h"
#include "bus-protocol.h"
#include "bus-signature.h"
+#include "fd-util.h"
#include "string-util.h"
#include "util.h"
-#include "bus-introspect.h"
int introspect_begin(struct introspect *i, bool trusted) {
assert(i);
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index 32246cbf59..f311e86d44 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -36,17 +36,18 @@
#include "bus-bloom.h"
#include "bus-internal.h"
+#include "bus-kernel.h"
#include "bus-label.h"
#include "bus-message.h"
#include "bus-util.h"
#include "capability.h"
+#include "fd-util.h"
#include "fileio.h"
#include "formats-util.h"
#include "memfd-util.h"
#include "string-util.h"
#include "strv.h"
#include "util.h"
-#include "bus-kernel.h"
#define UNIQUE_NAME_MAX (3+DECIMAL_STR_MAX(uint64_t))
diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c
index efab756ef4..58b19fbdc7 100644
--- a/src/libsystemd/sd-bus/bus-match.c
+++ b/src/libsystemd/sd-bus/bus-match.c
@@ -20,11 +20,12 @@
***/
#include "bus-internal.h"
+#include "bus-match.h"
#include "bus-message.h"
#include "bus-util.h"
+#include "fd-util.h"
#include "string-util.h"
#include "strv.h"
-#include "bus-match.h"
/* Example:
*
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 0e35b3a358..447e25db8a 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -27,16 +27,17 @@
#include "bus-gvariant.h"
#include "bus-internal.h"
+#include "bus-message.h"
#include "bus-signature.h"
#include "bus-type.h"
#include "bus-util.h"
+#include "fd-util.h"
#include "memfd-util.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
#include "utf8.h"
#include "util.h"
-#include "bus-message.h"
static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
index e4994b491f..3273d9b0c2 100644
--- a/src/libsystemd/sd-bus/bus-socket.c
+++ b/src/libsystemd/sd-bus/bus-socket.c
@@ -29,6 +29,8 @@
#include "bus-internal.h"
#include "bus-message.h"
+#include "bus-socket.h"
+#include "fd-util.h"
#include "formats-util.h"
#include "macro.h"
#include "missing.h"
@@ -36,7 +38,6 @@
#include "string-util.h"
#include "utf8.h"
#include "util.h"
-#include "bus-socket.h"
#define SNDBUF_SIZE (8*1024*1024)
diff --git a/src/libsystemd/sd-bus/bus-track.c b/src/libsystemd/sd-bus/bus-track.c
index e43891be25..0911156e19 100644
--- a/src/libsystemd/sd-bus/bus-track.c
+++ b/src/libsystemd/sd-bus/bus-track.c
@@ -20,9 +20,10 @@
***/
#include "sd-bus.h"
-#include "bus-util.h"
+
#include "bus-internal.h"
#include "bus-track.h"
+#include "bus-util.h"
struct sd_bus_track {
unsigned n_ref;
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index 04c6b1e8ef..b55e81ce97 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -30,6 +30,7 @@
#include "bus-util.h"
#include "busctl-introspect.h"
#include "escape.h"
+#include "fd-util.h"
#include "log.h"
#include "pager.h"
#include "path-util.h"
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 2fb483171e..7b91c2583d 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -44,6 +44,7 @@
#include "bus-util.h"
#include "cgroup-util.h"
#include "def.h"
+#include "fd-util.h"
#include "hostname-util.h"
#include "macro.h"
#include "missing.h"
diff --git a/src/libsystemd/sd-bus/test-bus-benchmark.c b/src/libsystemd/sd-bus/test-bus-benchmark.c
index 4c7c58f57e..549c88cd2d 100644
--- a/src/libsystemd/sd-bus/test-bus-benchmark.c
+++ b/src/libsystemd/sd-bus/test-bus-benchmark.c
@@ -27,6 +27,7 @@
#include "bus-kernel.h"
#include "bus-util.h"
#include "def.h"
+#include "fd-util.h"
#include "time-util.h"
#include "util.h"
diff --git a/src/libsystemd/sd-bus/test-bus-chat.c b/src/libsystemd/sd-bus/test-bus-chat.c
index c6a81a1894..e9e5e4a8e3 100644
--- a/src/libsystemd/sd-bus/test-bus-chat.c
+++ b/src/libsystemd/sd-bus/test-bus-chat.c
@@ -34,6 +34,7 @@
#include "log.h"
#include "macro.h"
#include "util.h"
+#include "fd-util.h"
static int match_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
log_info("Match triggered! interface=%s member=%s", strna(sd_bus_message_get_interface(m)), strna(sd_bus_message_get_member(m)));
diff --git a/src/libsystemd/sd-bus/test-bus-kernel-bloom.c b/src/libsystemd/sd-bus/test-bus-kernel-bloom.c
index 02ccbd7260..ff7f9cdafa 100644
--- a/src/libsystemd/sd-bus/test-bus-kernel-bloom.c
+++ b/src/libsystemd/sd-bus/test-bus-kernel-bloom.c
@@ -23,6 +23,7 @@
#include "bus-kernel.h"
#include "bus-util.h"
+#include "fd-util.h"
#include "log.h"
#include "util.h"
diff --git a/src/libsystemd/sd-bus/test-bus-kernel.c b/src/libsystemd/sd-bus/test-bus-kernel.c
index 436bc017a4..7d05953cd0 100644
--- a/src/libsystemd/sd-bus/test-bus-kernel.c
+++ b/src/libsystemd/sd-bus/test-bus-kernel.c
@@ -26,6 +26,7 @@
#include "bus-dump.h"
#include "bus-kernel.h"
#include "bus-util.h"
+#include "fd-util.h"
#include "log.h"
#include "util.h"
diff --git a/src/libsystemd/sd-bus/test-bus-marshal.c b/src/libsystemd/sd-bus/test-bus-marshal.c
index b54d931c1c..c0daa451ec 100644
--- a/src/libsystemd/sd-bus/test-bus-marshal.c
+++ b/src/libsystemd/sd-bus/test-bus-marshal.c
@@ -36,6 +36,7 @@
#include "bus-label.h"
#include "bus-message.h"
#include "bus-util.h"
+#include "fd-util.h"
#include "log.h"
#include "util.h"
diff --git a/src/libsystemd/sd-bus/test-bus-zero-copy.c b/src/libsystemd/sd-bus/test-bus-zero-copy.c
index 42c95240d4..1be0dbcd82 100644
--- a/src/libsystemd/sd-bus/test-bus-zero-copy.c
+++ b/src/libsystemd/sd-bus/test-bus-zero-copy.c
@@ -30,6 +30,7 @@
#include "memfd-util.h"
#include "string-util.h"
#include "util.h"
+#include "fd-util.h"
#define FIRST_ARRAY 17
#define SECOND_ARRAY 33