summaryrefslogtreecommitdiff
path: root/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
commit419ad717d7f8a33bfc6d80bf3263ce7f7afd82a1 (patch)
tree6c591fee3f016bd4992f545e99ec580fa9f14291 /cpp
parent8ad76093e682ee735314a6768709b77a09d152ec (diff)
downloadqpid-python-419ad717d7f8a33bfc6d80bf3263ce7f7afd82a1.tar.gz
Disable SIGPIPE for client as well as broker
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711624 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/sys/posix/AsynchIO.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/cpp/src/qpid/sys/posix/AsynchIO.cpp b/cpp/src/qpid/sys/posix/AsynchIO.cpp
index c8a8b3d0f1..569cafcb34 100644
--- a/cpp/src/qpid/sys/posix/AsynchIO.cpp
+++ b/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) {