summaryrefslogtreecommitdiff
path: root/src/mongo/db/initialize_server_global_state.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-09-16 14:46:11 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-09-16 14:46:11 -0400
commitf0d958c747cfc42dd831eb2f088e963475c0ed54 (patch)
tree39cac193f0b58c9d95c3774fb4964259975e840b /src/mongo/db/initialize_server_global_state.cpp
parent3174e2d67d077fa8362c3f1200024d69773344fd (diff)
downloadmongo-f0d958c747cfc42dd831eb2f088e963475c0ed54.tar.gz
SERVER-16725 Incorrect character conversion between UTF-8 and UTF-16
Diffstat (limited to 'src/mongo/db/initialize_server_global_state.cpp')
-rw-r--r--src/mongo/db/initialize_server_global_state.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp
index c6d0983e1d0..f552a238109 100644
--- a/src/mongo/db/initialize_server_global_state.cpp
+++ b/src/mongo/db/initialize_server_global_state.cpp
@@ -256,7 +256,9 @@ MONGO_INITIALIZER_GENERAL(ServerLogRedirection,
if (!serverGlobalParams.logAppend && boost::filesystem::is_regular(absoluteLogpath)) {
std::string renameTarget = absoluteLogpath + "." + terseCurrentTime(false);
- if (0 == rename(absoluteLogpath.c_str(), renameTarget.c_str())) {
+ boost::system::error_code ec;
+ boost::filesystem::rename(absoluteLogpath, renameTarget, ec);
+ if (!ec) {
log() << "log file \"" << absoluteLogpath << "\" exists; moved to \""
<< renameTarget << "\".";
} else {
@@ -267,7 +269,7 @@ MONGO_INITIALIZER_GENERAL(ServerLogRedirection,
<< "\" to \""
<< renameTarget
<< "\"; run with --logappend or manually remove file: "
- << errnoWithDescription());
+ << ec.message());
}
}
}