From 5b6651afacd4aa786f9331298e620ca4bfeafcb7 Mon Sep 17 00:00:00 2001 From: Yuan Zhou Date: Thu, 24 Jan 2019 14:05:44 +0800 Subject: [PATCH] common/buffer: assign error message to caller on short read in pread_file Signed-off-by: Yuan Zhou --- src/common/buffer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 41ed3c1ea2f..deb07bd516e 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; } -- 2.39.5