X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FCASCatch%2FCASCatch_CatchSignals.cxx;h=8798adcf0a18f310d59f49871e94fa96342c881e;hb=5796a26d6925386f93f18a3f5567e8ea85558d41;hp=ce25080a9da86c059eaeb6cfd948e15c160f0f46;hpb=5a7522a23dd83a48fd3ef216e0923ce351f3d810;p=modules%2Fgui.git diff --git a/src/CASCatch/CASCatch_CatchSignals.cxx b/src/CASCatch/CASCatch_CatchSignals.cxx index ce25080a9..8798adcf0 100644 --- a/src/CASCatch/CASCatch_CatchSignals.cxx +++ b/src/CASCatch/CASCatch_CatchSignals.cxx @@ -22,27 +22,24 @@ // File : CASCatch_CatchSignals.cxx // Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com) -// -#include "CASCatch_CatchSignals.hxx" +#include "CASCatch_CatchSignals.hxx" #include "CASCatch_Failure.hxx" #include "CASCatch_ErrorHandler.hxx" + #include #define MAX_HANDLER_NUMBER 6 - //================================================================================ /*! Public - * \brief creates a CASCatch_CatchSignals */ //================================================================================ CASCatch_CatchSignals::CASCatch_CatchSignals() - :myIsActivated(Standard_False) + : myIsActivated( Standard_False ) { - - Standard_Integer i = 0; - for(; i<=MAX_HANDLER_NUMBER; i++) + for ( Standard_Integer i = 0; i <= MAX_HANDLER_NUMBER; i++ ) mySigStates[i] = NULL; } @@ -64,9 +61,7 @@ CASCatch_CatchSignals::CASCatch_CatchSignals() #include #endif -//============================== typedef void (ACT_SIGIO_HANDLER)(void) ; - ACT_SIGIO_HANDLER *ADR_ACT_SIGIO_HANDLER = NULL ; typedef void (* SIG_PFV) (int); @@ -108,7 +103,7 @@ typedef void (* SIG_PFV) (int); * \brief universal handler for signals */ //================================================================================ -static void Handler(const OSD_Signals theSig, const OSD_Signals) +static void Handler(const int theSig) { sigset_t set; sigemptyset(&set); @@ -128,7 +123,7 @@ static void Handler(const OSD_Signals theSig, const OSD_Signals) * \brief handler for SIGSEGV signal */ //================================================================================ -static void SegvHandler(const OSD_Signals, const Standard_Address, const Standard_Address) +static void SegvHandler(const int, siginfo_t*, const Standard_Address) { sigset_t set; sigemptyset(&set); @@ -159,9 +154,8 @@ void CASCatch_CatchSignals::Activate() act.sa_handler = (SIG_PFV) &Handler ; sigemptyset(&act.sa_mask) ; - - stat = sigaction(SIGHUP,&act,(struct sigaction*)mySigStates[0]); // ...... hangup - stat = sigaction(SIGFPE,&act,(struct sigaction*) mySigStates[1]); // ...... floating point exception + stat = sigaction(SIGHUP,&act,(struct sigaction*)mySigStates[0]); // ...... hangup + stat = sigaction(SIGFPE,&act,(struct sigaction*) mySigStates[1]); // ...... floating point exception stat = sigaction(SIGINT,&act,(struct sigaction*)mySigStates[2]); // ...... interrupt stat = sigaction(SIGQUIT,&act,(struct sigaction*)mySigStates[3]); // ...... quit stat = sigaction(SIGBUS,&act,(struct sigaction*)mySigStates[4]); // ...... bus error