int ret;
if (fd < 0) {
ret = -errno;
- ldout(cct, 0) << "ext_mime_map_init(): failed to open file=" << ext_map << " ret=" << ret << dendl;
+ ldout(cct, 0) << __func__ << " failed to open file=" << ext_map
+ << " : " << cpp_strerror(-ret) << dendl;
return ret;
}
ret = fstat(fd, &st);
if (ret < 0) {
ret = -errno;
- ldout(cct, 0) << "ext_mime_map_init(): failed to stat file=" << ext_map << " ret=" << ret << dendl;
+ ldout(cct, 0) << __func__ << " failed to stat file=" << ext_map
+ << " : " << cpp_strerror(-ret) << dendl;
goto done;
}
buf = (char *)malloc(st.st_size + 1);
if (!buf) {
ret = -ENOMEM;
- ldout(cct, 0) << "ext_mime_map_init(): failed to allocate buf" << dendl;
+ ldout(cct, 0) << __func__ << " failed to allocate buf" << dendl;
goto done;
}
ret = safe_read(fd, buf, st.st_size + 1);
if (ret != st.st_size) {
// huh? file size has changed?
- ldout(cct, 0) << "ext_mime_map_init(): raced! will retry.." << dendl;
+ ldout(cct, 0) << __func__ << " raced! will retry.." << dendl;
free(buf);
close(fd);
return ext_mime_map_init(cct, ext_map);