summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-06-25 10:46:42 -0400
committerDwight <dmerriman@gmail.com>2008-06-25 10:46:42 -0400
commit24d5031c9b35ffea4601860f0320388b7b516324 (patch)
tree7cec9b954343d8b76a9c391c612bb1412d163343
parentfd39a9c15b046d2db924926fd11192a02fea1114 (diff)
parent240c50cee394684f99aaa2a85b0df952598af045 (diff)
downloadmongo-24d5031c9b35ffea4601860f0320388b7b516324.tar.gz
Merge branch 'master' of ssh://git.10gen.com/data/gitroot/p
-rw-r--r--db/db.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/db/db.cpp b/db/db.cpp
index 3f512cac6cc..6f9d101ea74 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -429,6 +429,10 @@ struct OpLog {
ss << "oplog." << hex << time(0);
string name = ss.str();
f = new ofstream(name.c_str(), ios::out | ios::binary);
+ if ( ! f->good() ){
+ cerr << "couldn't open log stream" << endl;
+ throw 1717;
+ }
}
} _oplog;
void flushOpLog() { _oplog.f->flush(); }
@@ -662,6 +666,9 @@ void setupSignals() {}
void initAndListen(int listenPort, const char *dbPath, const char *appserverLoc = null) {
+ _oplog.init();
+
+
#if !defined(_WIN32)
assert( signal(SIGSEGV, segvhandler) != SIG_ERR );
#endif
@@ -757,8 +764,7 @@ int main(int argc, char* argv[], char *envp[] )
return 0;
}
if( strcmp(argv[1], "run") == 0 ) {
- _oplog.init();
- initAndListen(port, dbpath);
+ initAndListen(port, dbpath);
goingAway = true;
return 0;
}