From: Yuan Zhou Date: Thu, 24 Jan 2019 06:05:44 +0000 (+0800) Subject: common/buffer: assign error message to caller on short read in pread_file X-Git-Tag: v15.0.0~136^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b6651afacd4aa786f9331298e620ca4bfeafcb7;p=ceph.git common/buffer: assign error message to caller on short read in pread_file Signed-off-by: Yuan Zhou --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 41ed3c1ea2f3..deb07bd516e6 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1806,8 +1806,8 @@ ssize_t buffer::list::pread_file(const char *fn, uint64_t off, uint64_t len, std if (off > st.st_size) { std::ostringstream oss; - oss << "bufferlist::read_file(" << fn << "): read error: size < offset " - << cpp_strerror(-1); + oss << "bufferlist::read_file(" << fn << "): read error: size < offset"; + *error = oss.str(); VOID_TEMP_FAILURE_RETRY(::close(fd)); return 0; }