You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2008/11/05 18:10:38 UTC

svn commit: r711624 - /incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp

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) {