aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-06-12 17:34:29 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-06-12 18:18:38 +0200
commitaec27ff7aae8d30161e85c227adb8f511dc282bb (patch)
tree6c4df1069b9dc486b18e8e0d7c85bc90bdbb9df4
parentd4227bd703ac28cae8c5860e358aea5f4d4de08e (diff)
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 <jose.bollo@iot.bzh>
-rw-r--r--src/sd-fds.c4
1 files changed, 2 insertions, 2 deletions
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;
}
}