diff options
author | Thomas Haller <thaller@redhat.com> | 2016-09-27 13:35:29 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-09-27 14:13:21 +0200 |
commit | e3a072f3c0d8046a9c1d01c8518c532b71f7bd7a (patch) | |
tree | fc59e7b009a14227dd825be31ad7bd0c59b41ae9 /src/tests | |
parent | 3f4aa48d6bc7302ffb38eda2d3c674f747516f37 (diff) | |
download | NetworkManager-e3a072f3c0d8046a9c1d01c8518c532b71f7bd7a.tar.gz |
build: don't add systemd path the include search path
Our internal copy of systemd should not be in the search path.
Instead, let users only
#include "systemd/nm-sd.h"
which then includes everything from systemd that we need.
We want to avoid to accidentally include anything from our
systemd-copy. Any user of that should only include "nm-sd.h",
which then includes everything that is needed further.
For example, "src/devices/wwan/nm-modem-manager.c" has
#include <systemd/nm-daemon.h>
which in turn includes
#include "_sd-common.h"
This works all correctly before, because #include "" will first
look in the directory where sd-daemon.h is. However, our mixing of
external systemd library and internal copy is rather dangerous.
Try to avoid it further by keeping the include paths clean.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/Makefile.am | 3 | ||||
-rw-r--r-- | src/tests/test-systemd.c | 6 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 8851c24279..c11e7a0b5f 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -123,8 +123,7 @@ test_wired_defname_LDADD = \ test_systemd_CFLAGS = \ "-I$(srcdir)/../" \ "-I$(srcdir)/../platform" \ - "-I$(srcdir)/../systemd" \ - "-I$(srcdir)/../systemd/src/systemd" + $(NULL) test_systemd_SOURCES = \ test-systemd.c diff --git a/src/tests/test-systemd.c b/src/tests/test-systemd.c index 744b55c992..078879601e 100644 --- a/src/tests/test-systemd.c +++ b/src/tests/test-systemd.c @@ -19,11 +19,7 @@ #include "nm-default.h" -#include "nm-sd.h" - -#include "sd-dhcp-client.h" -#include "sd-lldp.h" -#include "sd-event.h" +#include "systemd/nm-sd.h" #include "nm-test-utils-core.h" |