diff options
author | Bernard Normier <bernard@zeroc.com> | 2010-05-17 17:21:47 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2010-05-17 17:21:47 -0400 |
commit | 777f51e84d413efaed099bddba96c03c4c51eb17 (patch) | |
tree | d4bcfee203f4dd4244f90014f1b728770142f0c1 /cpp/src/Ice/Instance.cpp | |
parent | Updated openssl makefile for VC6 (diff) | |
download | ice-777f51e84d413efaed099bddba96c03c4c51eb17.tar.bz2 ice-777f51e84d413efaed099bddba96c03c4c51eb17.tar.xz ice-777f51e84d413efaed099bddba96c03c4c51eb17.zip |
SIGPIPE patch for Blair / Imageworks
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 8f801232ad0..be22705c9a4 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -71,6 +71,9 @@ namespace IceUtil::Mutex* staticMutex = 0; bool oneOffDone = false; int instanceCount = 0; +#ifndef _WIN32 +struct sigaction oldAction; +#endif bool printProcessIdDone = false; string identForOpenlog; @@ -870,8 +873,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi action.sa_handler = SIG_IGN; sigemptyset(&action.sa_mask); action.sa_flags = 0; - sigaction(SIGPIPE, &action, 0); - + sigaction(SIGPIPE, &action, &oldAction); if(_initData.properties->getPropertyAsInt("Ice.UseSyslog") > 0) { identForOpenlog = _initData.properties->getProperty("Ice.ProgramName"); @@ -1051,12 +1053,8 @@ IceInternal::Instance::~Instance() #endif #ifndef _WIN32 - struct sigaction action; - action.sa_handler = SIG_DFL; - sigemptyset(&action.sa_mask); - action.sa_flags = 0; - sigaction(SIGPIPE, &action, 0); - + sigaction(SIGPIPE, &oldAction, 0); + if(!identForOpenlog.empty()) { closelog(); |