Allow to remove systemd library
[src/app-framework-binder.git] / src / afb-socket.c
index cf788de..754baea 100644 (file)
 #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
 }