summaryrefslogtreecommitdiff
path: root/src/mongo/db/dur_journal.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-02-08 12:37:55 -0500
committerEliot Horowitz <eliot@10gen.com>2013-02-08 12:38:53 -0500
commit5ecb17b3c84ac55a0e46ae854b8e4cf85b24932d (patch)
tree3455c8193c6b62083f69ae8e914ee8266c5c71bb /src/mongo/db/dur_journal.cpp
parent536d1a6d520dbb6d022af9c2c27ea0efa9da48ac (diff)
downloadmongo-5ecb17b3c84ac55a0e46ae854b8e4cf85b24932d.tar.gz
if the journal directory doesn't exist, then can't be any journal files
Diffstat (limited to 'src/mongo/db/dur_journal.cpp')
-rw-r--r--src/mongo/db/dur_journal.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/dur_journal.cpp b/src/mongo/db/dur_journal.cpp
index be669281fba..cd413eab0a6 100644
--- a/src/mongo/db/dur_journal.cpp
+++ b/src/mongo/db/dur_journal.cpp
@@ -183,7 +183,11 @@ namespace mongo {
*/
bool haveJournalFiles(bool anyFiles) {
try {
- for ( boost::filesystem::directory_iterator i( getJournalDir() );
+ boost::filesystem::path jdir = getJournalDir();
+ if ( !boost::filesystem::exists( jdir ) )
+ return false;
+
+ for ( boost::filesystem::directory_iterator i( jdir );
i != boost::filesystem::directory_iterator();
++i ) {
string fileName = boost::filesystem::path(*i).leaf().string();