Main Page Class Hierarchy Compound List File List Compound Members File Members

# worm_signal.cpp

Go to the documentation of this file.

    00001 //---------------------------------------------------------------------------
    00002 #include "worm_signal.h"
    00003
    00004 #include <globalutils.h>
    00005
    00006 //---------------------------------------------------------------------------
    00007
    00008 #pragma package(smart_init)
    00009
    00010 void SignalHandler( int p_signum )
    00011 {
    00012    switch( p_signum )
    00013    {
    00014      case SIGINT:    // ^c
    00015      case SIGTERM:   // kill -15
    00016      case SIGABRT:   // kill -9
    00017 #ifdef SIGBREAK
    00018      case SIGBREAK:  // keyboard break
    00019 #endif
    00020           TGlobalUtils::SetTerminateFlag();
    00021           break;
    00022      default:
    00023           signal(p_signum, (SIG_HANDLR_PTR)SignalHandler);  //  reinstall signal handler
    00024           break;
    00025    }
    00026 }