From: Vincent Bernat Date: Mon, 3 Dec 2018 08:33:18 +0000 (+0100) Subject: daemon: check if started through systemd first X-Git-Tag: 1.0.3~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17f7469e20bb847b4102f4f3730b49504b3d5dbd;p=thirdparty%2Flldpd.git daemon: check if started through systemd first When running with `-d`, we may still need to send a notification to systemd, even if we didn't plan to daemonize. Fix #309. --- diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index 3f5733b8..1d92dd3c 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -1791,8 +1791,7 @@ lldpd_main(int argc, char *argv[], char *envp[]) /* Daemonization, unless started by systemd or launchd or debug */ #ifndef HOST_OS_OSX - if (daemonize && - !lldpd_started_by_systemd()) { + if (!lldpd_started_by_systemd() && daemonize) { int pid; char *spid; log_debug("main", "going into background");