fix shell

This commit is contained in:
Eliot Horowitz
2010-06-12 22:45:17 -04:00
parent 0fe7ef64f0
commit f6fe05bf9a

View File

@@ -266,7 +266,12 @@ namespace mongo {
p = change_extension(p, ".exe");
#endif
if( boost::filesystem::exists(p) ) return p;
if( boost::filesystem::exists(p) ){
#ifndef _WIN32
p = boost::filesystem::initial_path() / p;
#endif
return p;
}
{
boost::filesystem::path t = boost::filesystem::current_path() / p;
@@ -337,7 +342,8 @@ namespace mongo {
if ( program != "mongod" && program != "mongos" && program != "mongobridge" )
port_ = 0;
else {
cout << "error: a port number is expected when running mongod (etc.) from the shell" << endl;
if ( port_ <= 0 )
cout << "error: a port number is expected when running mongod (etc.) from the shell" << endl;
assert( port_ > 0 );
}
if ( port_ > 0 && dbs.count( port_ ) != 0 ){