0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

for testing

This commit is contained in:
dwight 2010-09-13 08:31:28 -04:00
parent c7417ff16c
commit d48a16161e
2 changed files with 11 additions and 3 deletions

View File

@ -133,8 +133,8 @@ namespace mongo {
boost::filesystem::path nsPath = path();
string pathString = nsPath.string();
MMF::Pointer p;
if( MMF::exists(nsPath) ) {
p = f.map(pathString.c_str());
if( MMF::exists(nsPath) ) {
p = f.mapWithOptions(pathString.c_str(), durable?MMF::READONLY:0);
if( !p.isNull() ) {
len = f.length();
if ( len % (1024*1024) != 0 ){
@ -148,7 +148,7 @@ namespace mongo {
massert( 10343 , "bad lenForNewNsFiles", lenForNewNsFiles >= 1024*1024 );
maybeMkdir();
unsigned long long l = lenForNewNsFiles;
p = f.map(pathString.c_str(), l);
p = f.map(pathString.c_str(), l, durable?MMF::READONLY:0);
if( !p.isNull() ) {
len = l;
assert( len == lenForNewNsFiles );

8
pch.h
View File

@ -93,6 +93,14 @@
namespace mongo {
/* this likely goes away later. to facilitate testing for a while without impacting other things. */
#if defined(_DURABLE)
const bool durable = true;
#error don't use this yet
#else
const bool durable = false;
#endif
using namespace std;
using boost::shared_ptr;