From c4beadbad3610264914cb98562facdbca9b38c54 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 30 Aug 2024 12:54:57 -0500 Subject: [PATCH] Fix a few issues with error reporting during sec2 reads --- src/H5FDsec2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 0a623e9cb36..13ac0575ce3 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -700,15 +700,16 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU int myerrno = errno; time_t mytime = time(NULL); +#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, 0, SEEK_CUR); +#endif HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " - "error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, " - "bytes actually read = %llu, offset = %llu", - ctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, - (unsigned long long)size, (unsigned long long)bytes_in, - (unsigned long long)bytes_read, (unsigned long long)offset); + "error message = '%s', buf = %p, total read size = %z, bytes this sub-read = %llu, " + "offset = %llu", + ctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, size, + (unsigned long long)bytes_in, (unsigned long long)offset); } /* end if */ if (0 == bytes_read) {