From ba693048ce1a2b629bfed11fceacabe7edc18a78 Mon Sep 17 00:00:00 2001 From: Jose Bollo Date: Tue, 19 Feb 2019 09:13:26 +0100 Subject: Allow to remove systemd library This change allows to compile a binder that doesn't use libsystemd. The restriction implied is that the neither the systemd event loop nor the systemd dbus facilities are availables. Consequently, the dbus transparancy of APIs isn't available. Also the work isn't fully complete because afb-ws-client doesn't handle the removal of libsystemd. A more general work still have to be made to allow the binder to run as library using an external event loop. Change-Id: I27a80862868b9c5a0453011a1d8aa3ce75cb5f6e Signed-off-by: Jose Bollo --- src/afb-socket.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/afb-socket.c') diff --git a/src/afb-socket.c b/src/afb-socket.c index cf788de6..754baea0 100644 --- a/src/afb-socket.c +++ b/src/afb-socket.c @@ -32,10 +32,13 @@ #include "afb-fdev.h" #include "afb-socket.h" -#include "systemd.h" #include "fdev.h" #include "verbose.h" +#if WITH_SYSTEMD +#include "systemd.h" +#endif + #define BACKLOG 5 /******************************************************************************/ @@ -225,11 +228,11 @@ static int open_tcp(const char *spec, int server, int reuseaddr) */ static int open_systemd(const char *spec) { -#if defined(NO_SYSTEMD_ACTIVATION) +#if WITH_SYSTEMD + return systemd_fds_for(spec); +#else errno = EAFNOSUPPORT; return -1; -#else - return systemd_fds_for(spec); #endif } -- cgit 1.2.3-korg