From 419ad717d7f8a33bfc6d80bf3263ce7f7afd82a1 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 5 Nov 2008 17:10:38 +0000 Subject: 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 --- cpp/src/qpid/sys/posix/AsynchIO.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'cpp/src') 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) { -- cgit v1.2.1