summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/dur_recover.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/mongo/db/dur_recover.cpp b/src/mongo/db/dur_recover.cpp
index 07d605ce16e..b3f4ce986a2 100644
--- a/src/mongo/db/dur_recover.cpp
+++ b/src/mongo/db/dur_recover.cpp
@@ -183,29 +183,18 @@ namespace mongo {
};
static string fileName(const char* dbName, int fileNo) {
- boost::filesystem::path full(dbpath);
-
- StackStringBuilder ss;
- ss << full.string();
-
-#ifdef _WIN32
- static const char pathSep = '\\';
-#else
- static const char pathSep = '/';
-#endif
-
- if (!dbpath.empty() && dbpath[dbpath.size()-1] != pathSep)
- ss << pathSep;
-
+ stringstream ss;
ss << dbName << '.';
verify( fileNo >= 0 );
-
if( fileNo == JEntry::DotNsSuffix )
ss << "ns";
else
ss << fileNo;
- return ss.str();
+ // relative name -> full path name
+ boost::filesystem::path full(dbpath);
+ full /= ss.str();
+ return full.string();
}
RecoveryJob::~RecoveryJob() {