summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 449bb005b..240db1c88 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -152,6 +152,7 @@ using irc::sockets::insp_inaddr;
using irc::sockets::insp_sockaddr;
InspIRCd* SI = NULL;
+int* mysig = NULL;
/* Burlex: Moved from exitcodes.h -- due to duplicate symbols */
const char* ExitCodes[] =
@@ -305,7 +306,7 @@ void InspIRCd::SetSignals()
{
#ifndef WIN32
signal(SIGALRM, SIG_IGN);
- signal(SIGHUP, InspIRCd::Rehash);
+ signal(SIGHUP, InspIRCd::SetSignal);
signal(SIGPIPE, SIG_IGN);
signal(SIGCHLD, SIG_IGN);
#endif
@@ -411,6 +412,8 @@ InspIRCd::InspIRCd(int argc, char** argv)
memset(&server, 0, sizeof(server));
memset(&client, 0, sizeof(client));
+ this->s_signal = 0;
+
this->unregistered_count = 0;
this->clientlist = new user_hash();
@@ -704,6 +707,13 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
/* If any inspsockets closed, remove them */
this->InspSocketCull();
+
+ if (this->s_signal)
+ {
+ this->SignalHandler(s_signal);
+ this->s_signal = 0;
+ }
+
}
void InspIRCd::InspSocketCull()
@@ -736,6 +746,7 @@ int InspIRCd::Run()
int main(int argc, char** argv)
{
SI = new InspIRCd(argc, argv);
+ mysig = &SI->s_signal;
SI->Run();
delete SI;
return 0;
@@ -804,3 +815,9 @@ int InspIRCd::GetTimeDelta()
{
return time_delta;
}
+
+void InspIRCd::SetSignal(int signal)
+{
+ *mysig = signal;
+}
+