]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/buffer: assign error message to caller on short read in pread_file
authorYuan Zhou <yuan.zhou@intel.com>
Thu, 24 Jan 2019 06:05:44 +0000 (14:05 +0800)
committerYuan Zhou <yuan.zhou@intel.com>
Thu, 21 Mar 2019 16:16:28 +0000 (00:16 +0800)
Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
src/common/buffer.cc

index 41ed3c1ea2f3b7f79ad73332b72232ff2f091572..deb07bd516e6b73892c45f4db0bec4b6a8c3cd53 100644 (file)
@@ -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;
   }