diff options
author | Peter Powell <petpow@saberuk.com> | 2013-05-07 03:55:29 +0100 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-05-07 05:00:33 +0200 |
commit | b89aa87280767f47381b8a612f73f1d0fe682e2e (patch) | |
tree | 5d6ee39e4b091e90cb3ff6e629aa80d21e3e4ab4 /src | |
parent | 8790551dc182cd8804ee7d8ef89ccb31067cc2a4 (diff) |
Clean up cross-platform compatibility.
- Move compatibility macros to a new header file.
- Sort system include files in alphabetical order.
- Clean up signal handling (thanks to Adam).
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 7b3d36e1c..775e6f130 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -62,7 +62,6 @@ #include "testsuite.h" InspIRCd* ServerInstance = NULL; -int* mysig = NULL; /** Seperate from the other casemap tables so that code *can* still exclusively rely on RFC casemapping * if it must. @@ -322,8 +321,6 @@ InspIRCd::InspIRCd(int argc, char** argv) : /* Default implementation does nothing */ this->PI = new ProtocolInterface; - this->s_signal = 0; - // Create base manager classes early, so nothing breaks this->Users = new UserManager; @@ -787,10 +784,10 @@ int InspIRCd::Run() GlobalCulls.Apply(); AtomicActions.Run(); - if (this->s_signal) + if (s_signal) { this->SignalHandler(s_signal); - this->s_signal = 0; + s_signal = 0; } } @@ -799,10 +796,6 @@ int InspIRCd::Run() /**********************************************************************************/ -/** - * An ircd in five lines! bwahahaha. ahahahahaha. ahahah *cough*. - */ - /* this returns true when all modules are satisfied that the user should be allowed onto the irc server * (until this returns true, a user will block in the waiting state, waiting to connect up to the * registration timeout maximum seconds) @@ -814,9 +807,11 @@ bool InspIRCd::AllModulesReportReady(LocalUser* user) return (res == MOD_RES_PASSTHRU); } +sig_atomic_t InspIRCd::s_signal = 0; + void InspIRCd::SetSignal(int signal) { - *mysig = signal; + s_signal = signal; } /* On posix systems, the flow of the program starts right here, with @@ -828,7 +823,6 @@ void InspIRCd::SetSignal(int signal) ENTRYPOINT { new InspIRCd(argc, argv); - mysig = &ServerInstance->s_signal; ServerInstance->Run(); delete ServerInstance; return 0; |