qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r711624 - /incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
Date Wed, 05 Nov 2008 17:10:38 GMT
Author: gsim
Date: Wed Nov  5 09:10:38 2008
New Revision: 711624

URL: http://svn.apache.org/viewvc?rev=711624&view=rev
Log:
Disable SIGPIPE for client as well as broker


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp?rev=711624&r1=711623&r2=711624&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp Wed Nov  5 09:10:38 2008
@@ -40,13 +40,16 @@
 
 namespace {
 
-/*
- * Make *process* not generate SIGPIPE when writing to closed
- * pipe/socket (necessary as default action is to terminate process)
- */
-void ignoreSigpipe() {
-    ::signal(SIGPIPE, SIG_IGN);
-}
+struct StaticInit {
+    StaticInit() {
+
+        /**
+         * Make *process* not generate SIGPIPE when writing to closed
+         * pipe/socket (necessary as default action is to terminate process)
+         */
+        ::signal(SIGPIPE, SIG_IGN);
+        };
+} init;
 
 /*
  * We keep per thread state to avoid locking overhead. The assumption is that
@@ -103,7 +106,6 @@
     socket(s) {
 
     s.setNonblocking();
-    ignoreSigpipe();
 }
 
 void AsynchAcceptorPrivate::start(Poller::shared_ptr poller) {



Mime
View raw message