]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/ConfUtils.cc: ConfFile:parse_file: warn about ENOENT
authorDan Mick <dan.mick@redhat.com>
Mon, 24 Apr 2017 22:35:14 +0000 (15:35 -0700)
committerDan Mick <dan.mick@redhat.com>
Mon, 24 Apr 2017 22:43:26 +0000 (15:43 -0700)
Consider ENOENT an error; it may or may not be reported, but
accumulate it as if it might be

Signed-off-by: Dan Mick <dan.mick@redhat.com>
src/common/ConfUtils.cc

index 2c403d950c8f51c4826c3ee6d69cc3256e98b1c1..ff9055a8164c0f4807b7173cadf5f80607615c54 100644 (file)
@@ -101,6 +101,9 @@ parse_file(const std::string &fname, std::deque<std::string> *errors,
   char *buf = NULL;
   FILE *fp = fopen(fname.c_str(), "r");
   if (!fp) {
+    ostringstream oss;
+    oss << "parse_file: cannot open " << fname << ": " << cpp_strerror(errno);
+    errors->push_back(oss.str());
     ret = -errno;
     return ret;
   }