Remove call to daemon(). Just call setsid() and close
any relevent descriptors (0,2,[1]). We've already fork()d. PR: 3874
This commit is contained in:
parent
0f606585b8
commit
d656a4c582
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.c,v 1.60 1997/06/09 03:27:28 brian Exp $
|
||||
* $Id: main.c,v 1.61 1997/06/11 03:57:48 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Add commands for traffic summary, version display, etc.
|
||||
@ -510,17 +510,20 @@ char **argv;
|
||||
if (server >= 0)
|
||||
LogPrintf(LogPHASE, "Listening at %d.\n", port);
|
||||
|
||||
VarTerm = 0; /* We know it's currently stdin */
|
||||
VarTerm = 0; /* We know it's currently stdout */
|
||||
close(0);
|
||||
close(2);
|
||||
|
||||
#ifdef DOTTYINIT
|
||||
if (mode & (MODE_DIRECT|MODE_DEDICATED)) { /* } */
|
||||
if (mode & (MODE_DIRECT|MODE_DEDICATED))
|
||||
#else
|
||||
if (mode & MODE_DIRECT) {
|
||||
if (mode & MODE_DIRECT)
|
||||
#endif
|
||||
chdir("/"); /* Be consistent with daemon() */
|
||||
TtyInit();
|
||||
} else
|
||||
daemon(0,0);
|
||||
else {
|
||||
setsid();
|
||||
close(1);
|
||||
}
|
||||
} else {
|
||||
TtyInit();
|
||||
TtyCommandMode(1);
|
||||
|
Loading…
Reference in New Issue
Block a user