SERVER-1517 Heapcheck 'mongod' and 'mongos' only (fix core tests)

This commit is contained in:
Alberto Lerner
2010-08-10 15:36:29 -04:00
parent 17d553904f
commit 04d9cfb67c

View File

@@ -545,9 +545,14 @@ namespace mongo {
#if defined(HEAP_CHECKING)
env[0] = "HEAPCHECK=normal";
env[1] = NULL;
// Heap-check for mongod and mongos only. 'argv[0]' must be in the path format.
if ( ( argv_[0].find("mongod") != string::npos) || ( argv_[0].find("mongos") != string::npos) ){
execvpe( argv[ 0 ], const_cast<char**>(argv) , const_cast<char**>(env) );
}
#endif // HEAP_CHECKING
execve( argv[ 0 ], const_cast<char**>(argv), const_cast<char**>(env) );
execvp( argv[ 0 ], const_cast<char**>(argv) );
cout << "Unable to start program " << argv[0] << ' ' << errnoWithDescription() << endl;
::_Exit(-1);