From 9415124c9756b89565ed4ae493634e322793b428 Mon Sep 17 00:00:00 2001 From: Yan Jun Date: Mon, 20 Jun 2016 14:16:52 +0800 Subject: [PATCH] rgw: ext_mime_map_init add string describing for error number Signed-off-by: Yan Jun --- src/rgw/rgw_tools.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index e97b432f00799..5f64955402025 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -123,7 +123,8 @@ static int ext_mime_map_init(CephContext *cct, const char *ext_map) 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; } @@ -131,21 +132,22 @@ static int ext_mime_map_init(CephContext *cct, const char *ext_map) 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); -- 2.39.5