[67807] trunk/dports/devel/ice-cpp

blair at macports.org blair at macports.org
Tue May 18 13:09:13 PDT 2010


Revision: 67807
          http://trac.macports.org/changeset/67807
Author:   blair at macports.org
Date:     2010-05-18 13:09:10 -0700 (Tue, 18 May 2010)
Log Message:
-----------
Add a patch from ZeroC that fixes an issue where upon destruction of
the last Ice communicator, SIGPIPE's disposition is set to SIG_DFL, not
the disposition before the first Ice communicator was constructed.

Modified Paths:
--------------
    trunk/dports/devel/ice-cpp/Portfile

Added Paths:
-----------
    trunk/dports/devel/ice-cpp/files/patch-ice.cpp.src.Ice.Instance.cpp.diff

Modified: trunk/dports/devel/ice-cpp/Portfile
===================================================================
--- trunk/dports/devel/ice-cpp/Portfile	2010-05-18 19:47:45 UTC (rev 67806)
+++ trunk/dports/devel/ice-cpp/Portfile	2010-05-18 20:09:10 UTC (rev 67807)
@@ -4,6 +4,7 @@
 
 name            ice-cpp
 version         3.4.0
+revision        1
 set branch      [join [lrange [split ${version} .] 0 1] .]
 categories      devel
 maintainers     blair
@@ -34,7 +35,8 @@
 
 distname        Ice-${version}
 patchfiles      patch-ice.cpp.config.Make.rules.diff \
-                patch-ice.cpp.config.Make.rules.Darwin.diff
+                patch-ice.cpp.config.Make.rules.Darwin.diff \
+                patch-ice.cpp.src.Ice.Instance.cpp.diff
 patch.pre_args  -p1
 checksums       md5 998b10627ade020cb00f5beb73efc0e0 \
                 sha1 1c8fe296af8d65d16cddac39a8bc24b71e069f75 \

Added: trunk/dports/devel/ice-cpp/files/patch-ice.cpp.src.Ice.Instance.cpp.diff
===================================================================
--- trunk/dports/devel/ice-cpp/files/patch-ice.cpp.src.Ice.Instance.cpp.diff	                        (rev 0)
+++ trunk/dports/devel/ice-cpp/files/patch-ice.cpp.src.Ice.Instance.cpp.diff	2010-05-18 20:09:10 UTC (rev 67807)
@@ -0,0 +1,115 @@
+diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
+index 8f80123..be22705 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();
+diff --git a/cpp/test/Ice/interceptor/Client.cpp b/cpp/test/Ice/interceptor/Client.cpp
+index fcc2203..c20cfe8 100644
+--- a/cpp/test/Ice/interceptor/Client.cpp
++++ b/cpp/test/Ice/interceptor/Client.cpp
+@@ -15,6 +15,14 @@
+ #include <AMDInterceptorI.h>
+ #include <iostream>
+ 
++#ifndef _WIN32
++//
++// SIGPIPE test
++//
++#   include <signal.h>
++#endif
++
++
+ using namespace std;
+ 
+ class Client : public Ice::Application
+@@ -29,16 +37,55 @@ private:
+     int runAmd(const Test::MyObjectPrx&, const AMDInterceptorIPtr&); 
+ };
+ 
++#ifndef _WIN32
++void testAction(int)
++{
++    test(false);
++}
++#endif
++
+ int
+ main(int argc, char* argv[])
+ {
++#ifndef _WIN32
++//
++// Set SIGPIPE action
++//
++    struct sigaction action;
++    action.sa_handler = &testAction;
++    sigemptyset(&action.sa_mask);
++    action.sa_flags = 0;
++    sigaction(SIGPIPE, &action, 0);
++#endif
++
+     Client app;
+-    return app.main(argc, argv);
++    int result = app.main(argc, argv);
++
++#ifndef _WIN32
++//
++// Check SIGPIPE was properly reset to old action
++//
++    struct sigaction newAction;
++    sigaction(SIGPIPE, 0, &newAction);
++    test(action.sa_handler == &testAction);
++#endif
++
++    return result;
+ }
+ 
+ int
+ Client::run(int, char*[])
+ {
++
++#ifndef _WIN32
++//
++// Check SIGPIPE is now SIG_IGN
++//
++    struct sigaction action;
++    sigaction(SIGPIPE, 0, &action);
++    test(action.sa_handler == SIG_IGN);
++#endif
++
+     //
+     // Create OA and servants  
+     //  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100518/0165fd18/attachment.html>


More information about the macports-changes mailing list