From 7b6b2661c0a97684543e22f67603e4821a8d5bf1 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sat, 17 Aug 2002 22:15:31 +0000 Subject: changed to FbTk EventHandler with SignalEvent --- src/SignalHandler.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/SignalHandler.cc b/src/SignalHandler.cc index 67f83fa..2ef2cd6 100644 --- a/src/SignalHandler.cc +++ b/src/SignalHandler.cc @@ -19,13 +19,13 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: SignalHandler.cc,v 1.1 2002/08/13 23:57:04 fluxgen Exp $ +// $Id: SignalHandler.cc,v 1.2 2002/08/17 22:15:31 fluxgen Exp $ #include "SignalHandler.hh" namespace FbTk { -SignalHandler::EventHandler *SignalHandler::s_signal_handler[NSIG]; +EventHandler *SignalHandler::s_signal_handler[NSIG]; SignalHandler::SignalHandler() { // clear signal list @@ -38,7 +38,8 @@ SignalHandler *SignalHandler::instance() { return &singleton; } -bool SignalHandler::registerHandler(int signum, EventHandler *eh, EventHandler **oldhandler_ret) { +bool SignalHandler::registerHandler(int signum, EventHandler *eh, + EventHandler **oldhandler_ret) { // must be less than NSIG if (signum >= NSIG) return false; @@ -68,8 +69,11 @@ void SignalHandler::removeHandler(int signum) { void SignalHandler::handleSignal(int signum) { // make sure we got a handler for this signal - if (s_signal_handler[signum] != 0) - s_signal_handler[signum]->handleSignal(signum); + if (s_signal_handler[signum] != 0) { + SignalEvent sigev; + sigev.signum = signum; + s_signal_handler[signum]->handleEvent(&sigev); + } } }; -- cgit v0.11.2