summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/client.c b/client.c
index ff89e6f8..9cd5ad85 100644
--- a/client.c
+++ b/client.c
@@ -21,11 +21,10 @@
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/wait.h>
+#include <sys/file.h>
#include <errno.h>
-#include <event.h>
#include <fcntl.h>
-#include <imsg.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
@@ -282,6 +281,12 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
log_debug("flags are %#llx", (unsigned long long)client_flags);
/* Initialize the client socket and start the server. */
+#ifdef HAVE_SYSTEMD
+ if (systemd_activated()) {
+ /* socket-based activation, do not even try to be a client. */
+ fd = server_start(client_proc, flags, base, 0, NULL);
+ } else
+#endif
fd = client_connect(base, socket_path, client_flags);
if (fd == -1) {
if (errno == ECONNREFUSED) {
@@ -345,7 +350,9 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
cfmakeraw(&tio);
tio.c_iflag = ICRNL|IXANY;
tio.c_oflag = OPOST|ONLCR;
+#ifdef NOKERNINFO
tio.c_lflag = NOKERNINFO;
+#endif
tio.c_cflag = CREAD|CS8|HUPCL;
tio.c_cc[VMIN] = 1;
tio.c_cc[VTIME] = 0;