summaryrefslogtreecommitdiff
path: root/src/mongo/tools/tool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/tools/tool.cpp')
-rw-r--r--src/mongo/tools/tool.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/tools/tool.cpp b/src/mongo/tools/tool.cpp
index c092cdbd51a..5dc3e90b67c 100644
--- a/src/mongo/tools/tool.cpp
+++ b/src/mongo/tools/tool.cpp
@@ -308,6 +308,9 @@ namespace mongo {
if ( useDirectClient )
dbexit( EXIT_CLEAN );
+
+ fflush(stdout);
+ fflush(stderr);
return ret;
}
@@ -423,8 +426,10 @@ namespace mongo {
}
string errmsg;
- if ( _conn->auth( dbname , _username , _password , errmsg, true, level ) ) {
- return;
+ if (dbname.size()) {
+ if ( _conn->auth( dbname , _username , _password , errmsg, true, level ) ) {
+ return;
+ }
}
// try against the admin db