]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
squashme: review comments 14757/head
authorDan Mick <dan.mick@redhat.com>
Tue, 25 Apr 2017 06:39:52 +0000 (23:39 -0700)
committerDan Mick <dan.mick@redhat.com>
Tue, 25 Apr 2017 06:39:52 +0000 (23:39 -0700)
Signed-off-by: Dan Mick <dan.mick@redhat.com>
src/common/ConfUtils.cc
src/librados/librados.cc

index bd964edeb05400d63a088806c04e3e10e8bb28ea..b8e8edbce022ea323bb8cc5cab79275d00c96775 100644 (file)
@@ -102,7 +102,7 @@ parse_file(const std::string &fname, std::deque<std::string> *errors,
   FILE *fp = fopen(fname.c_str(), "r");
   if (!fp) {
     ostringstream oss;
-    oss << "parse_file: cannot open " << fname << ": " << cpp_strerror(errno);
+    oss << __func__ << ": cannot open " << fname << ": " << cpp_strerror(errno);
     errors->push_back(oss.str());
     ret = -errno;
     return ret;
@@ -112,14 +112,14 @@ parse_file(const std::string &fname, std::deque<std::string> *errors,
   if (fstat(fileno(fp), &st_buf)) {
     ret = -errno;
     ostringstream oss;
-    oss << "parse_file: failed to fstat '" << fname << "': " << cpp_strerror(ret);
+    oss << __func__ << ": failed to fstat '" << fname << "': " << cpp_strerror(ret);
     errors->push_back(oss.str());
     goto done;
   }
 
   if (st_buf.st_size > MAX_CONFIG_FILE_SZ) {
     ostringstream oss;
-    oss << "parse_file: config file '" << fname << "' is " << st_buf.st_size
+    oss << __func__ << ": config file '" << fname << "' is " << st_buf.st_size
        << " bytes, but the maximum is " << MAX_CONFIG_FILE_SZ;
     errors->push_back(oss.str());
     ret = -EINVAL;
@@ -137,14 +137,14 @@ parse_file(const std::string &fname, std::deque<std::string> *errors,
     if (ferror(fp)) {
       ret = -errno;
       ostringstream oss;
-      oss << "parse_file: fread error while reading '" << fname << "': "
+      oss << __func__ << ": fread error while reading '" << fname << "': "
          << cpp_strerror(ret);
       errors->push_back(oss.str());
       goto done;
     }
     else {
       ostringstream oss;
-      oss << "parse_file: unexpected EOF while reading '" << fname << "': "
+      oss << __func__ << ": unexpected EOF while reading '" << fname << "': "
          << "possible concurrent modification?";
       errors->push_back(oss.str());
       ret = -EIO;
index 44a632f02953f5d5793fa1312023e7f126916e91..3c063260bf125b9181d6f65d73857ce0d6fc304c 100644 (file)
@@ -2823,7 +2823,7 @@ extern "C" int rados_conf_read_file(rados_t cluster, const char *path_list)
   ostringstream warnings;
   int ret = conf->parse_config_files(path_list, &warnings, 0);
   if (ret) {
-    if (warnings.str().length())
+    if (warnings.tellp() > 0)
       lderr(client->cct) << warnings.str() << dendl;
     client->cct->_conf->complain_about_parse_errors(client->cct);
     tracepoint(librados, rados_conf_read_file_exit, ret);