diff options
author | yellow <yellow@ofc-n1.10gen.com> | 2008-06-25 09:00:42 -0400 |
---|---|---|
committer | yellow <yellow@ofc-n1.10gen.com> | 2008-06-25 09:00:42 -0400 |
commit | 240c50cee394684f99aaa2a85b0df952598af045 (patch) | |
tree | f475177d53ea257e777bf84ef6c0708022cb6e82 | |
parent | 26dea1fcd61c67d30f596b68f746659ddb98d3a0 (diff) | |
download | mongo-r0.0.5_rc1.tar.gz |
from eliotr0.0.5_rc1
need to call log init in a more general place
-rw-r--r-- | db/db.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/db/db.cpp b/db/db.cpp index 79885b45019..89a438b8754 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; } |