From: José Bollo Date: Mon, 12 Jun 2017 15:34:29 +0000 (+0200) Subject: Fix issue in using systemd socket activation X-Git-Tag: dab_3.99.2~13 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=aec27ff7aae8d30161e85c227adb8f511dc282bb;p=src%2Fapp-framework-binder.git Fix issue in using systemd socket activation When afb-daemon was launched without systemd it crashed in sd_fds_for. Change-Id: I481f5d1a24ec45f8cacae32792b2e47dfa62f611 Signed-off-by: José Bollo --- diff --git a/src/sd-fds.c b/src/sd-fds.c index 477da520..d904954c 100644 --- a/src/sd-fds.c +++ b/src/sd-fds.c @@ -37,9 +37,9 @@ int sd_fds_init() else { init_done = 1; rc = sd_listen_fds_with_names(1, &names); - if (rc < 0) { + if (rc <= 0) { errno = -rc; - rc = -1; + rc = -!!rc; names = &null; } }