summaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 4fc9c1eef..08d4aed08 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -252,12 +252,9 @@ void Fork()
#ifndef _WIN32
kill(getppid(), SIGUSR2);
- if (isatty(fileno(stdout)))
- fclose(stdout);
- if (isatty(fileno(stdin)))
- fclose(stdin);
- if (isatty(fileno(stderr)))
- fclose(stderr);
+ freopen("/dev/null", "r", stdin);
+ freopen("/dev/null", "w", stdout);
+ freopen("/dev/null", "w", stderr);
setpgid(0, 0);
#else
@@ -456,7 +453,7 @@ void Init(int ac, char **av)
/* Create me */
Me = new Server(NULL, Config->ServerName, 0, Config->ServerDesc, Config->Numeric);
- for (botinfo_map::iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it)
+ for (botinfo_map::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it)
it->second->server = Me;
/* Announce ourselves to the logfile. */