summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-11-05 17:10:38 +0000
committerGordon Sim <gsim@apache.org>2008-11-05 17:10:38 +0000
commit914d58b60a53dc1c938d0a85ac5ac5f14d96c8cf (patch)
tree7cd255c2671911361a2f378cc96a761458244c65 /qpid/cpp
parent65ad0983bf7521a8a5255cfeac307609376bab9e (diff)
downloadqpid-python-914d58b60a53dc1c938d0a85ac5ac5f14d96c8cf.tar.gz
Disable SIGPIPE for client as well as broker
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@711624 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp b/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
index c8a8b3d0f1..569cafcb34 100644
--- a/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
+++ b/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
@@ -40,13 +40,16 @@ using namespace qpid::sys;
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 @@ AsynchAcceptorPrivate::AsynchAcceptorPrivate(const Socket& s,
socket(s) {
s.setNonblocking();
- ignoreSigpipe();
}
void AsynchAcceptorPrivate::start(Poller::shared_ptr poller) {