From 89da82a2356f0f656feb104aae043f9f89cc94b4 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Thu, 29 Aug 2013 02:51:49 +0200 Subject: [PATCH] Doubts about setsid. TODO some day. --- Daemon/javafork.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Daemon/javafork.c b/Daemon/javafork.c index 5500539..2f56b58 100644 --- a/Daemon/javafork.c +++ b/Daemon/javafork.c @@ -59,11 +59,15 @@ int main (int argc, char *argv[]) /*This process is intended to be used as a daemon, it sould be launched by the INIT process, because of that*/ /*we are not forking it (INIT needs it)*/ + /*TODO: I think this is not needed because setsid function performs it*/ if (daemonize(argv[0], LOG_SYSLOG, LOG_PID) < 0) return -1; /*Changing session.*/ - setsid(); + if (setsid() < 0) { + syslog (LOG_ERR, "setsid failed: %m"); + return -1; + } opterr = 0; -- 2.1.4