From 034074d71af6e01d4b663a0566e5668d3d3dad98 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 26 Apr 2007 19:21:24 +0000 Subject: 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 --- src/inspircd.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') 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"); -- cgit v1.2.3