summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp1
-rw-r--r--src/inspircd_io.cpp10
2 files changed, 8 insertions, 3 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index b68f4934e..6d21e3677 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -199,6 +199,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
memset(&Config->implement_lists,0,sizeof(Config->implement_lists));
printf("\n");
+ SetSignals();
if (!Config->nofork)
{
if (DaemonSeed() == ERROR)
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index b0170d0a3..dd5b14692 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -404,15 +404,19 @@ void WritePID(std::string filename)
}
}
-
-int DaemonSeed (void)
+void SetSignals()
{
- int childpid;
signal (SIGALRM, SIG_IGN);
signal (SIGHUP, Rehash);
signal (SIGPIPE, SIG_IGN);
signal (SIGTERM, Exit);
signal (SIGSEGV, Error);
+}
+
+
+int DaemonSeed (void)
+{
+ int childpid;
if ((childpid = fork ()) < 0)
return (ERROR);
else if (childpid > 0)