diff options
author | Mathias Stearn <mathias@10gen.com> | 2016-02-04 13:47:21 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2016-02-04 17:44:32 -0500 |
commit | 34b7d4013ec098761a52712e49c1458fb998f67f (patch) | |
tree | dca5970c4fe5117dc18206d79fb70a30d0ee1ec4 /src/mongo/db/ftdc | |
parent | 63ec8aba9a6853f128ad988a695ade50cd1c0324 (diff) | |
download | mongo-34b7d4013ec098761a52712e49c1458fb998f67f.tar.gz |
SERVER-20352 Correctly check for errors from boost::filesystem::create_directories
Diffstat (limited to 'src/mongo/db/ftdc')
-rw-r--r-- | src/mongo/db/ftdc/file_manager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/ftdc/file_manager.cpp b/src/mongo/db/ftdc/file_manager.cpp index 489dcd8bd73..9ba445fe2f7 100644 --- a/src/mongo/db/ftdc/file_manager.cpp +++ b/src/mongo/db/ftdc/file_manager.cpp @@ -72,9 +72,12 @@ StatusWith<std::unique_ptr<FTDCFileManager>> FTDCFileManager::create( if (!boost::filesystem::exists(dir)) { // Create the directory - if (!boost::filesystem::create_directories(dir)) { + boost::system::error_code ec; + boost::filesystem::create_directories(dir, ec); + if (ec) { return {ErrorCodes::NonExistentPath, - str::stream() << "\'" << dir.generic_string() << "\' could not be created."}; + str::stream() << "\'" << dir.generic_string() + << "\' could not be created: " << ec.message()}; } } |