chiark / gitweb /
log: minimize includes in log.h
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Jan 2018 23:39:12 +0000 (00:39 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:50:07 +0000 (07:50 +0200)
commit1189a9f9f521ab79f1f8fb94434c7f4cbac88ef0
tree2e23c6b8fa76655e1d437cf2bbe37dbc23857dd0
parent345fe418feab4d06953d1d50ed40399e470cbee8
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)
33 files changed:
src/basic/errno-list.c
src/basic/fs-util.c
src/basic/gunicode.c
src/basic/hash-funcs.c
src/basic/hostname-util.h
src/basic/log.c
src/basic/log.h
src/basic/process-util.h
src/basic/random-util.c
src/basic/socket-util.c
src/basic/stat-util.c
src/basic/time-util.c
src/basic/verbs.c
src/libelogind/sd-bus/bus-control.c
src/libelogind/sd-bus/bus-gvariant.c
src/libelogind/sd-bus/bus-signature.c
src/libelogind/sd-bus/bus-socket.c
src/libelogind/sd-bus/bus-type.c
src/libelogind/sd-bus/bus-type.h
src/libelogind/sd-bus/sd-bus.c
src/libelogind/sd-daemon/sd-daemon.c
src/libelogind/sd-id128/id128-util.c
src/login/logind-core.c
src/login/logind.c
src/shared/test-tables.h
src/test/test-cgroup.c
src/test/test-extract-word.c
src/test/test-hash.c
src/test/test-hexdecoct.c
src/test/test-log.c
src/test/test-parse-util.c
src/test/test-sizeof.c
src/test/test-util.c