diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-03-16 10:10:58 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-03-17 13:01:40 +0100 |
commit | 3d3964b1190c03ff7463aaae9f712dfc67291c91 (patch) | |
tree | 6d99fe1464a4630e2fa69a4d8a5ff89bde306273 /src/utils-systemd.c | |
parent | 550ca0ae2bb9138c85fda941b67d4db1da1609ed (diff) |
Allows to compile without libsystemd
This fixes a problem with bitbake when building
native packages.
Change-Id: I28586720010237db578ec55cb5254212c88240e7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/utils-systemd.c')
-rw-r--r-- | src/utils-systemd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/utils-systemd.c b/src/utils-systemd.c index b8c3c0b..d804144 100644 --- a/src/utils-systemd.c +++ b/src/utils-systemd.c @@ -27,8 +27,15 @@ #include <sys/types.h> #include <sys/stat.h> -#include <systemd/sd-bus.h> -#include <systemd/sd-bus-protocol.h> +#ifndef NO_LIBSYSTEMD +# include <systemd/sd-bus.h> +# include <systemd/sd-bus-protocol.h> +#else + struct sd_bus; +# define sd_bus_default_user(p) ((*(p)=NULL),(-ENOTSUP)) +# define sd_bus_default_system(p) ((*(p)=NULL),(-ENOTSUP)) +# define sd_bus_call_method(...) (-ENOTSUP) +#endif #include "utils-systemd.h" |