From: Dan Mick Date: Tue, 25 Apr 2017 06:39:52 +0000 (-0700) Subject: squashme: review comments X-Git-Tag: v12.0.3~245^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14757%2Fhead;p=ceph.git squashme: review comments Signed-off-by: Dan Mick --- diff --git a/src/common/ConfUtils.cc b/src/common/ConfUtils.cc index bd964edeb05..b8e8edbce02 100644 --- a/src/common/ConfUtils.cc +++ b/src/common/ConfUtils.cc @@ -102,7 +102,7 @@ parse_file(const std::string &fname, std::deque *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 *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 *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; diff --git a/src/librados/librados.cc b/src/librados/librados.cc index 44a632f0295..3c063260bf1 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -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);