From 240c50cee394684f99aaa2a85b0df952598af045 Mon Sep 17 00:00:00 2001 From: yellow Date: Wed, 25 Jun 2008 09:00:42 -0400 Subject: from eliot need to call log init in a more general place --- db/db.cpp | 10 ++++++++-- 1 file 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; } -- cgit v1.2.1