diff --git a/db/db.cpp b/db/db.cpp index f6bb202ecfd..db9e3914114 100644 --- a/db/db.cpp +++ b/db/db.cpp @@ -336,7 +336,7 @@ namespace mongo { Timer startupSrandTimer; void acquirePathLock() { -#if !defined(_WIN32) and !defined(__sunos__) +#if !defined(_WIN32) && !defined(__sunos__) string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string(); lockFile = open( name.c_str(), O_RDONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO ); massert( "Unable to create / open lock file for dbpath: " + name, lockFile > 0 ); diff --git a/db/db.vcproj b/db/db.vcproj index 9594f73e683..ed820dbaf1a 100644 --- a/db/db.vcproj +++ b/db/db.vcproj @@ -52,7 +52,7 @@ WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" - DisableSpecificWarnings="4355" + DisableSpecificWarnings="4355;4800" /> + + diff --git a/db/instance.cpp b/db/instance.cpp index 403479ab9af..bee42f979bb 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -665,7 +665,7 @@ namespace mongo { // should we be locked here? we aren't. might be ok as-is. recCacheCloseAll(); -#if !defined(_WIN32) and !defined(__sunos__) +#if !defined(_WIN32) && !defined(__sunos__) flock( lockFile, LOCK_UN ); #endif diff --git a/db/pdfile.cpp b/db/pdfile.cpp index a09dfdc0bc0..bdf40b62094 100644 --- a/db/pdfile.cpp +++ b/db/pdfile.cpp @@ -120,6 +120,8 @@ namespace mongo { size += 256; size &= 0xffffffffffffff00LL; } + + uassert( "invalid size spec", size > 0 ); bool newCapped = false; int mx = 0; diff --git a/s/dbgrid.vcproj b/s/dbgrid.vcproj index fd5dcc7d560..2135cd26063 100644 --- a/s/dbgrid.vcproj +++ b/s/dbgrid.vcproj @@ -50,7 +50,7 @@ PrecompiledHeaderThrough="stdafx.h" WarningLevel="3" DebugInformationFormat="4" - DisableSpecificWarnings="4355" + DisableSpecificWarnings="4355;4800" />