From: Thibault Godouet Date: Thu, 14 Dec 2000 18:09:43 +0000 (+0000) Subject: added setsid() X-Git-Tag: ver2_9_4~476 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=193e017285daa152c6486738e4a8018772cf6481;p=thirdparty%2Ffcron.git added setsid() --- 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