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;
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;
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;
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);