From 193e017285daa152c6486738e4a8018772cf6481 Mon Sep 17 00:00:00 2001 From: Thibault Godouet Date: Thu, 14 Dec 2000 18:09:43 +0000 Subject: [PATCH] added setsid() --- fcron.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fcron.c b/fcron.c index befc90c..f34e65b 100644 --- a/fcron.c +++ b/fcron.c @@ -21,11 +21,11 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcron.c,v 1.34 2000-11-16 17:57:11 thib Exp $ */ + /* $Id: fcron.c,v 1.35 2000-12-14 18:09:43 thib Exp $ */ #include "fcron.h" -char rcs_info[] = "$Id: fcron.c,v 1.34 2000-11-16 17:57:11 thib Exp $"; +char rcs_info[] = "$Id: fcron.c,v 1.35 2000-12-14 18:09:43 thib Exp $"; void main_loop(void); void check_signal(void); @@ -406,6 +406,10 @@ main(int argc, char **argv) close(1); dup2(i, 1); close(2); dup2(i, 2); + /* finally, create a new session */ + if ( setsid() == -1 ) + error("Could not setsid()"); + } /* if we are in foreground, check if another fcron daemon -- 2.47.3