diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-01-11 00:39:12 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-05-30 07:50:07 +0200 |
commit | 1189a9f9f521ab79f1f8fb94434c7f4cbac88ef0 (patch) | |
tree | 2e23c6b8fa76655e1d437cf2bbe37dbc23857dd0 /src/test | |
parent | 345fe418feab4d06953d1d50ed40399e470cbee8 (diff) |
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.c | 1 | ||||
-rw-r--r-- | src/test/test-extract-word.c | 1 | ||||
-rw-r--r-- | src/test/test-hash.c | 1 | ||||
-rw-r--r-- | src/test/test-hexdecoct.c | 2 | ||||
-rw-r--r-- | src/test/test-log.c | 2 | ||||
-rw-r--r-- | src/test/test-parse-util.c | 1 | ||||
-rw-r--r-- | src/test/test-sizeof.c | 1 | ||||
-rw-r--r-- | src/test/test-util.c | 1 |
8 files changed, 9 insertions, 1 deletions
diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c index 5b06b9b1a..232577a70 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" /// Additional includes needed by elogind diff --git a/src/test/test-extract-word.c b/src/test/test-extract-word.c index c8f735607..cff40a4fb 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 f3b4258d6..a08771abb 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 fdb1d1ae3..5756340f3 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 3754b1285..242092bc1 100644 --- a/src/test/test-log.c +++ b/src/test/test-log.c @@ -23,9 +23,9 @@ #include "format-util.h" #include "log.h" -#include "util.h" /// Additional includes needed by elogind #include "process-util.h" +//#include "util.h" assert_cc(LOG_REALM_REMOVE_LEVEL(LOG_REALM_PLUS_LEVEL(LOG_REALM_SYSTEMD, LOG_FTP | LOG_DEBUG)) == LOG_REALM_SYSTEMD); diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c index 241145806..668b5cdee 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-sizeof.c b/src/test/test-sizeof.c index cdca954ea..0d96b02c2 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-util.c b/src/test/test-util.c index c08a51a95..1bb39a69d 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" |