diff options
author | Adam <Adam@anope.org> | 2011-05-23 04:41:51 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-05-23 04:41:51 -0400 |
commit | 8bf8832b70dea28e2048d5952ee03247f12bda92 (patch) | |
tree | f76f670690c105ec8f9ca079d868e930fd8f205b /include/services.h | |
parent | 4dd7e261f5704569856b5854dcc1f68010f0aaad (diff) |
Rewrote the signal handling to use sigaction
Diffstat (limited to 'include/services.h')
-rw-r--r-- | include/services.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/services.h b/include/services.h index f329f99ef..35342e1da 100644 --- a/include/services.h +++ b/include/services.h @@ -241,6 +241,23 @@ class DatabaseException : public CoreException virtual ~DatabaseException() throw() { } }; +class Signal +{ + static std::vector<Signal *> SignalHandlers; + static void SignalHandler(int signal); + + struct sigaction action; + sig_atomic_t called; + public: + static void Process(); + + int signal; + + Signal(int s); + ~Signal(); + virtual void OnSignal() = 0; +}; + /** Debug cast to be used instead of dynamic_cast, this uses dynamic_cast * for debug builds and static_cast on releass builds to speed up the program * because dynamic_cast relies on RTTI. |