From: Ted Lemon Date: Thu, 12 Sep 1996 09:28:13 +0000 (+0000) Subject: Close std{in,out,err} when daemonizing X-Git-Tag: BETA_5_12~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62e303ddb5a63350092641a5cc4feec97e24b298;p=thirdparty%2Fdhcp.git Close std{in,out,err} when daemonizing --- diff --git a/dhcpd.c b/dhcpd.c index 7aa6c4564..b46b74bb5 100644 --- a/dhcpd.c +++ b/dhcpd.c @@ -42,7 +42,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.35 1996/09/11 18:53:32 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium."; +"$Id: dhcpd.c,v 1.36 1996/09/12 09:28:13 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium."; #endif static char copyright[] = @@ -171,6 +171,9 @@ int main (argc, argv, envp) else if (pid) exit (0); /* Become session leader and get pid... */ + close (0); + close (1); + close (2); pid = setsid (); } diff --git a/server/dhcpd.c b/server/dhcpd.c index 7aa6c4564..b46b74bb5 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -42,7 +42,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.35 1996/09/11 18:53:32 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium."; +"$Id: dhcpd.c,v 1.36 1996/09/12 09:28:13 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium."; #endif static char copyright[] = @@ -171,6 +171,9 @@ int main (argc, argv, envp) else if (pid) exit (0); /* Become session leader and get pid... */ + close (0); + close (1); + close (2); pid = setsid (); }