From bfda8fc1c57030890f2de9b01302ba06ffc4cf79 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 3 Mar 2006 12:25:01 +0000 Subject: [PATCH] Remove unused files --- src/Utils/Makefile.in | 2 - src/Utils/Utils_SignalsHandler.cxx | 123 ----------------------------- src/Utils/Utils_SignalsHandler.h | 63 --------------- 3 files changed, 188 deletions(-) delete mode 100644 src/Utils/Utils_SignalsHandler.cxx delete mode 100644 src/Utils/Utils_SignalsHandler.h diff --git a/src/Utils/Makefile.in b/src/Utils/Makefile.in index c862428f3..a3edc9fa1 100644 --- a/src/Utils/Makefile.in +++ b/src/Utils/Makefile.in @@ -46,7 +46,6 @@ EXPORT_HEADERS= \ Utils_SINGLETON.hxx \ Utils_DESTRUCTEUR_GENERIQUE.hxx \ Utils_ExceptHandlers.hxx \ - Utils_SignalsHandler.h \ Utils_Mutex.hxx EXPORT_PYSCRIPTS = Utils_Identity.py SALOME_utilities.py @@ -59,7 +58,6 @@ LIB_SRC = OpUtil.cxx Utils_Timer.cxx duplicate.cxx \ Utils_Identity.cxx Utils_ORB_INIT.cxx \ Utils_DESTRUCTEUR_GENERIQUE.cxx \ Utils_ExceptHandlers.cxx \ - Utils_SignalsHandler.cxx \ Utils_Mutex.cxx LIB_SERVER_IDL = SALOME_Exception.idl diff --git a/src/Utils/Utils_SignalsHandler.cxx b/src/Utils/Utils_SignalsHandler.cxx deleted file mode 100644 index c96747334..000000000 --- a/src/Utils/Utils_SignalsHandler.cxx +++ /dev/null @@ -1,123 +0,0 @@ -// KERNEL Utils : common utils for KERNEL -// Copyright (C) 2003 CEA -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org - - -#include -#include -#include - -#include "Utils_SignalsHandler.h" - - -//============================================================================ -//function : Handler -//purpose : univisal handler for signals -//============================================================================ -static void Handler(int theSigId) -{ - char aMessage[256] = ""; - sprintf(aMessage,"Signal with ID = %d was cautch!",theSigId); - throw std::runtime_error(aMessage); -} - - -//======================================================================= -//function : SetSigHandler -//purpose : Redefine signal handlers. If the handler of the signal is -// set as SIG_IGN. That's why the shells often ignore some -// signal when starting child processes. We keep it. -//======================================================================= -static void SetSignalHandler(Utils_SignalsHandler::TSigHandlerCont& theSigHandlerCont, - int theSigId) -{ - TSigHandler anOldHandler = signal(theSigId,&Handler); - if(anOldHandler == SIG_IGN) - signal(theSigId,SIG_IGN); - theSigHandlerCont[theSigId] = anOldHandler; -} - -static TSigHandler StoreSignalHandler(Utils_SignalsHandler::TSigHandlerCont& theSigHandlerCont, - int theSigId) -{ - TSigHandler anOldHandler = signal(theSigId,&Handler); - signal(theSigId,anOldHandler); - if(anOldHandler == SIG_IGN) - signal(theSigId,SIG_IGN); - theSigHandlerCont[theSigId] = anOldHandler; - return anOldHandler; -} - -static void RestoreSigHandler(TSigHandler theSigHandler, - int theSigId) -{ - signal(theSigId,theSigHandler); -} - - -//======================================================================= -//function : Utils_SignalsHandler -//purpose : Constructor -//======================================================================= -Utils_SignalsHandler::Utils_SignalsHandler() -{ - // asv 28.02.05 : some signals are not defined on Windows.. why? I don't know.. -#ifndef WNT - StoreSignalHandler(mySigHandlerCont,SIGHUP); // floating point exception - StoreSignalHandler(mySigHandlerCont,SIGQUIT); // quit - StoreSignalHandler(mySigHandlerCont,SIGBUS); // bus error - StoreSignalHandler(mySigHandlerCont,SIGSTKFLT); // stack fault. -#endif - StoreSignalHandler(mySigHandlerCont,SIGFPE); // floating point exception - StoreSignalHandler(mySigHandlerCont,SIGINT); // interrupt - StoreSignalHandler(mySigHandlerCont,SIGILL); // illegal instruction - StoreSignalHandler(mySigHandlerCont,SIGTERM); // termination - StoreSignalHandler(mySigHandlerCont,SIGSEGV); // segmentation - //StoreSignalHandler(mySigHandlerCont,SIGABRT); // abort (ANSI). - // portage CCRT - // StoreSignalHandler(mySigHandlerCont,SIGSTKFLT); // stack fault. -} - - -//======================================================================= -//function : Utils_SignalsHandler -//purpose : destructor -//======================================================================= -Utils_SignalsHandler::~Utils_SignalsHandler() -{ - TSigHandlerCont::iterator anIter = mySigHandlerCont.begin(); - TSigHandlerCont::iterator anIterEnd = mySigHandlerCont.end(); - for(; anIter != anIterEnd; anIter++) - RestoreSigHandler(anIter->second,anIter->first); -} - - -//======================================================================= -//function : SetSigHandler -//purpose : sets new handler for pointed signal -//======================================================================= -TSigHandler Utils_SignalsHandler::SetSigHandler(int theSigId, - TSigHandler theSigHandler) -{ - TSigHandler anOldHandler = signal(theSigId,theSigHandler); - if(anOldHandler == SIG_IGN) - signal(theSigId,SIG_IGN); - mySigHandlerCont[theSigId] = anOldHandler; - return anOldHandler; -} diff --git a/src/Utils/Utils_SignalsHandler.h b/src/Utils/Utils_SignalsHandler.h deleted file mode 100644 index 44228ba87..000000000 --- a/src/Utils/Utils_SignalsHandler.h +++ /dev/null @@ -1,63 +0,0 @@ -// KERNEL Utils : common utils for KERNEL -// Copyright (C) 2003 CEA -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org - -#ifndef _UTILS_SIGNALSHANDLER_H_ -#define _UTILS_SIGNALSHANDLER_H_ - - -#if defined UTILS_EXPORTS -#if defined WIN32 -#define UTILS_EXPORT __declspec( dllexport ) -#else -#define UTILS_EXPORT -#endif -#else -#if defined WNT -#define UTILS_EXPORT __declspec( dllimport ) -#else -#define UTILS_EXPORT -#endif -#endif - -#include -typedef void (*TSigHandler)(int); - - -class UTILS_EXPORT Utils_SignalsHandler{ - public: - Utils_SignalsHandler(); - ~Utils_SignalsHandler(); - - TSigHandler GetSigHandler(int theSigId); - TSigHandler SetSigHandler(int theSigId, TSigHandler theSigHandler); - typedef std::map TSigHandlerCont; - - private: - TSigHandlerCont mySigHandlerCont; -}; - - -class UTILS_EXPORT Utils_CASSignalsHandler: private Utils_SignalsHandler{ - public: - Utils_CASSignalsHandler(); -}; - - -#endif -- 2.39.2