summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2012-07-23 10:48:08 -0400
committerEric Milkie <milkie@10gen.com>2012-07-27 11:33:21 -0400
commit6aa80782bc30162efb8f736863ed4b6bf2e94244 (patch)
tree7ce1b4ee88d26fd5c70fa54500c56d7b13d2b643
parentc88805a6f6447458290719703887fb736692359e (diff)
downloadmongo-6aa80782bc30162efb8f736863ed4b6bf2e94244.tar.gz
SERVER-6509 ignore SIGPIPE rather than printing a message
Solaris was crashing because we were using signal() instead of sigaction() to install the dummy signal handler for SIGPIPE. SIGPIPE is supressed via the socket library on other operating systems but this is not an option on Solaris. Conflicts: db/db.cpp
-rw-r--r--db/db.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/db/db.cpp b/db/db.cpp
index 2a08ff3db3e..e250745583a 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -1055,14 +1055,6 @@ namespace mongo {
namespace mongo {
- void pipeSigHandler( int signal ) {
-#ifdef psignal
- psignal( signal, "Signal Received : ");
-#else
- cout << "got pipe signal:" << signal << endl;
-#endif
- }
-
void abruptQuit(int x) {
ostringstream ossSig;
ossSig << "Got signal: " << x << " (" << strsignal( x ) << ")." << endl;
@@ -1134,7 +1126,7 @@ namespace mongo {
assert( signal(SIGABRT, abruptQuit) != SIG_ERR );
assert( signal(SIGQUIT, abruptQuit) != SIG_ERR );
- assert( signal(SIGPIPE, pipeSigHandler) != SIG_ERR );
+ assert( signal(SIGPIPE, SIG_IGN) != SIG_ERR );
setupSIGTRAPforGDB();