summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e6d70fa)
raw | patch | inline | side by side (parent: e6d70fa)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 18 Nov 2014 08:21:42 +0000 (09:21 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 18 Nov 2014 08:59:05 +0000 (09:59 +0100) |
Fixes #809 (build issue on MacOSX)
NB: in case one day upstart is used on non-Linux platforms, this could
be relaxed to only skip systemd.
NB: in case one day upstart is used on non-Linux platforms, this could
be relaxed to only skip systemd.
src/daemon/collectd.c | patch | blob | history |
diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c
index 309af1badfadacb642a59b34317fed261576bc68..1b9c3747a629fb6027460a3d1e88cb379c96ec4b 100644 (file)
--- a/src/daemon/collectd.c
+++ b/src/daemon/collectd.c
} /* static int pidfile_remove (const char *file) */
#endif /* COLLECT_DAEMON */
+#ifdef KERNEL_LINUX
int notify_upstart (void)
{
const char *upstart_job = getenv("UPSTART_JOB");
close(fd);
return 1;
}
+#endif /* KERNEL_LINUX */
int main (int argc, char **argv)
{
/*
* Only daemonize if we're not being supervised
- * by upstart or systemd.
+ * by upstart or systemd (when using Linux).
*/
- if (daemonize && notify_upstart() == 0 && notify_systemd() == 0)
+ if (daemonize
+#ifdef KERNEL_LINUX
+ && notify_upstart() == 0 && notify_systemd() == 0
+#endif
+ )
{
if ((pid = fork ()) == -1)
{