summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-04-17 10:12:32 -0400
committerDwight <dmerriman@gmail.com>2008-04-17 10:12:32 -0400
commiteb204a454cfc4c9ae427b48cfd01fe2a4921a59e (patch)
treeae6c353d376330bca42cae8177900da6d2c1bf78
parent84fd0d5390c5432eebfe27ea1c17556af02fcd87 (diff)
parentf3a45cf3a1d29530bf5ccb7d6181a2e1e7c4a667 (diff)
downloadmongo-eb204a454cfc4c9ae427b48cfd01fe2a4921a59e.tar.gz
Merge branch 'master' of ssh://git.10gen.com/data/gitroot/p
-rw-r--r--db/db.cpp8
-rw-r--r--stdafx.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/db/db.cpp b/db/db.cpp
index 52d77deddaf..3d693a2cbdf 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -432,7 +432,7 @@ void connThread()
cout << curTimeMillis() % 10000 << " end msg" << endl;
dbMsgPort.shutdown();
sleepmillis(500);
- exit(1);
+ exit(EXIT_SUCCESS);
}
}
else if( m.data->operation == dbQuery ) {
@@ -569,8 +569,14 @@ void initAndListen(int listenPort, const char *dbPath) {
listen(listenPort);
}
+void sigHandler( int signal ) {
+ psignal( signal, "Signal Received : ");
+} /*handler*/
+
int main(int argc, char* argv[], char *envp[] )
{
+ signal(SIGPIPE, sigHandler);
+
srand(curTimeMillis());
if( argc >= 2 ) {
diff --git a/stdafx.h b/stdafx.h
index b3f78fb0310..567f37be5b5 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -39,6 +39,7 @@ void wasserted(const char *msg, const char *file, unsigned line);
#include <stdio.h>
#include <sstream>
+#include <signal.h>
typedef char _TCHAR;