From 4bdc18a73971f1a474de9a818436b47b9509d287 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 24 Apr 2017 23:39:52 -0700 Subject: [PATCH] squashme: review comments Signed-off-by: Dan Mick --- src/common/ConfUtils.cc | 10 +++++----- src/librados/librados.cc | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/ConfUtils.cc b/src/common/ConfUtils.cc index bd964edeb0540..b8e8edbce022e 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 44a632f02953f..3c063260bf125 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); -- 2.39.5