summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-01-11 00:39:12 +0100
committerLennart Poettering <lennart@poettering.net>2018-01-11 14:44:31 +0100
commitdccca82b1a28c861a466a0905faee19ee009429a (patch)
treee6933b1f4ba8b9cd2c076c98c55e08f5ac72a1db /src/test
parent1a86b085138234c9166614adc5ad399a19dae84b (diff)
downloadsystemd-dccca82b1a28c861a466a0905faee19ee009429a.tar.gz
log: minimize includes in log.h
log.h really should only include the bare minimum of other headers, as it is really pulled into pretty much everything else and already in itself one of the most basic pieces of code we have. Let's hence drop inclusion of: 1. sd-id128.h because it's entirely unneeded in current log.h 2. errno.h, dito. 3. sys/signalfd.h which we can replace by a simple struct forward declaration 4. process-util.h which was needed for getpid_cached() which we now hide in a funciton log_emergency_level() instead, which nicely abstracts the details away. 5. sys/socket.h which was needed for struct iovec, but a simple struct forward declaration suffices for that too. Ultimately this actually makes our source tree larger (since users of the functionality above must now include it themselves, log.h won't do that for them), but I think it helps to untangle our web of includes a tiny bit. (Background: I'd like to isolate the generic bits of src/basic/ enough so that we can do a git submodule import into casync for it)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-cgroup.c1
-rw-r--r--src/test/test-extract-word.c1
-rw-r--r--src/test/test-hash.c1
-rw-r--r--src/test/test-hexdecoct.c2
-rw-r--r--src/test/test-log.c1
-rw-r--r--src/test/test-ns.c1
-rw-r--r--src/test/test-parse-util.c1
-rw-r--r--src/test/test-signal-util.c1
-rw-r--r--src/test/test-sizeof.c1
-rw-r--r--src/test/test-socket-util.c1
-rw-r--r--src/test/test-tmpfiles.c1
-rw-r--r--src/test/test-util.c1
-rw-r--r--src/test/test-watchdog.c1
13 files changed, 14 insertions, 0 deletions
diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
index 2ae95db162..b2440fc3a9 100644
--- a/src/test/test-cgroup.c
+++ b/src/test/test-cgroup.c
@@ -23,6 +23,7 @@
#include "cgroup-util.h"
#include "path-util.h"
+#include "process-util.h"
#include "string-util.h"
#include "util.h"
diff --git a/src/test/test-extract-word.c b/src/test/test-extract-word.c
index 84ab083e87..3e7c197cfe 100644
--- a/src/test/test-extract-word.c
+++ b/src/test/test-extract-word.c
@@ -19,6 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/test/test-hash.c b/src/test/test-hash.c
index f3b4258d6b..0366727476 100644
--- a/src/test/test-hash.c
+++ b/src/test/test-hash.c
@@ -18,6 +18,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <stdio.h>
#include "alloc-util.h"
diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
index 4f19cb406f..3e25a0bac8 100644
--- a/src/test/test-hexdecoct.c
+++ b/src/test/test-hexdecoct.c
@@ -18,6 +18,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+
#include "alloc-util.h"
#include "hexdecoct.h"
#include "macro.h"
diff --git a/src/test/test-log.c b/src/test/test-log.c
index 9468349cba..fd19899480 100644
--- a/src/test/test-log.c
+++ b/src/test/test-log.c
@@ -23,6 +23,7 @@
#include "format-util.h"
#include "log.h"
+#include "process-util.h"
#include "util.h"
assert_cc(LOG_REALM_REMOVE_LEVEL(LOG_REALM_PLUS_LEVEL(LOG_REALM_SYSTEMD, LOG_FTP | LOG_DEBUG))
diff --git a/src/test/test-ns.c b/src/test/test-ns.c
index 76e2b38b17..87b4facb85 100644
--- a/src/test/test-ns.c
+++ b/src/test/test-ns.c
@@ -18,6 +18,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c
index 8259e133c3..9375002133 100644
--- a/src/test/test-parse-util.c
+++ b/src/test/test-parse-util.c
@@ -19,6 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
#include <locale.h>
#include <math.h>
diff --git a/src/test/test-signal-util.c b/src/test/test-signal-util.c
index 13a1d2ba1f..f4b19ed69d 100644
--- a/src/test/test-signal-util.c
+++ b/src/test/test-signal-util.c
@@ -23,6 +23,7 @@
#include "macro.h"
#include "signal-util.h"
+#include "process-util.h"
static void test_block_signals(void) {
sigset_t ss;
diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
index cc07dc3634..aed6db8423 100644
--- a/src/test/test-sizeof.c
+++ b/src/test/test-sizeof.c
@@ -19,6 +19,7 @@
***/
#include <stdio.h>
+#include <string.h>
#include "time-util.h"
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c
index 5b1574e8ea..d1ab7486ed 100644
--- a/src/test/test-socket-util.c
+++ b/src/test/test-socket-util.c
@@ -28,6 +28,7 @@
#include "in-addr-util.h"
#include "log.h"
#include "macro.h"
+#include "process-util.h"
#include "socket-util.h"
#include "string-util.h"
#include "util.h"
diff --git a/src/test/test-tmpfiles.c b/src/test/test-tmpfiles.c
index c479eccb8b..8e57fe0461 100644
--- a/src/test/test-tmpfiles.c
+++ b/src/test/test-tmpfiles.c
@@ -29,6 +29,7 @@
#include "format-util.h"
#include "fs-util.h"
#include "log.h"
+#include "process-util.h"
#include "string-util.h"
#include "util.h"
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 2124511bf0..21d90f0888 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -28,6 +28,7 @@
#include "fileio.h"
#include "fs-util.h"
#include "parse-util.h"
+#include "process-util.h"
#include "raw-clone.h"
#include "rm-rf.h"
#include "string-util.h"
diff --git a/src/test/test-watchdog.c b/src/test/test-watchdog.c
index e068d1ddd4..ffcf408f57 100644
--- a/src/test/test-watchdog.c
+++ b/src/test/test-watchdog.c
@@ -18,6 +18,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <string.h>
#include <unistd.h>
#include "env-util.h"