Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20352

FTDC incorrectly checking return from boost::filesystem::create_directories

    • Fully Compatible
    • ALL
    • v3.2
    • Integration 10 (02/22/16)

      A false return indicates that the directory already exists, it is not used to signal errors.

      Original description: Coverity analysis defect 73690: Unchecked return value

      Value returned from a function is not checked for errors before being used

      Defect 73690 (STATIC_C)
      Checker CHECKED_RETURN (subcategory none)
      File: /src/mongo/db/sorter/sorter.cpp
      Function mongo::SortedFileWriter<mongo::Value, mongo::Document>::SortedFileWriter(const mongo::SortOptions &, const std::pair<mongo::Value::SorterDeserializeSettings, mongo::Document::SorterDeserializeSettings> &)
      /src/mongo/db/sorter/sorter.cpp, line: 817
      Calling "create_directories" without checking return value (as is done elsewhere 1 out of 2 times).

              boost::filesystem::create_directories(opts.tempDir);
      

      File: /src/mongo/db/sorter/sorter.cpp
      Function mongo::SortedFileWriter<mongo::Value, mongo::Value>::SortedFileWriter(const mongo::SortOptions &, const std::pair<mongo::Value::SorterDeserializeSettings, mongo::Value::SorterDeserializeSettings> &)
      /src/mongo/db/sorter/sorter.cpp, line: 817
      Calling "create_directories" without checking return value (as is done elsewhere 1 out of 2 times).

              boost::filesystem::create_directories(opts.tempDir);
      

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: