summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryellow <yellow@ofc-n1.10gen.com>2008-06-25 09:00:42 -0400
committeryellow <yellow@ofc-n1.10gen.com>2008-06-25 09:00:42 -0400
commit240c50cee394684f99aaa2a85b0df952598af045 (patch)
treef475177d53ea257e777bf84ef6c0708022cb6e82
parent26dea1fcd61c67d30f596b68f746659ddb98d3a0 (diff)
downloadmongo-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.cpp10
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;
}