summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-26 19:21:24 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-26 19:21:24 +0000
commit034074d71af6e01d4b663a0566e5668d3d3dad98 (patch)
treefa5fee9478acf7be1df418956023da310a9fa775 /src
parent37a53f1ac69315f1915aae67a447fb7b813e8217 (diff)
When running in nofork, keep the tty open (we were closing it, which meant that while we were in -nofork we would see no logs!)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6845 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 670b24441..46e469d61 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -373,6 +373,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
strlcpy(Config->MyExecutable,argv[0],MAXBUF);
this->OpenLog(argv, argc);
+
this->stats = new serverstats();
this->Timers = new TimerManager(this);
this->Parser = new CommandParser(this);
@@ -478,9 +479,16 @@ InspIRCd::InspIRCd(int argc, char** argv)
* e.g. we are restarting, or being launched by cron. Dont kill parent, and dont
* close stdin/stdout
*/
- fclose(stdin);
- fclose(stderr);
- fclose(stdout);
+ if (!do_nofork)
+ {
+ fclose(stdin);
+ fclose(stderr);
+ fclose(stdout);
+ }
+ else
+ {
+ Log(DEFAULT,"Keeping pseudo-tty open as we are running in the foreground.");
+ }
}
printf("\nInspIRCd is now running!\n");