summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index a26fa553..1bef8850 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1817,9 +1817,10 @@ rw_gbe_file_exact(int fd, u8 *mem, size_t nrw,
{
size_t mem_addr;
size_t buf_addr;
+ ssize_t r;
- if (mem == NULL)
- goto err_rw_gbe_file_exact;
+ if (io_args(fd, mem, nrw, off, rw_type) == -1)
+ return -1;
mem_addr = (size_t)(void *)mem;
buf_addr = (size_t)(void *)buf;
@@ -1841,10 +1842,12 @@ rw_gbe_file_exact(int fd, u8 *mem, size_t nrw,
if (nrw > (size_t)GBE_PART_SIZE)
goto err_rw_gbe_file_exact;
- return rw_file_exact(fd, mem, nrw, off, rw_type,
+ r = rw_file_exact(fd, mem, nrw, off, rw_type,
NO_LOOP_EAGAIN, LOOP_EINTR, MAX_ZERO_RW_RETRY,
OFF_ERR);
+ return rw_over_nrw(r, nrw);
+
err_rw_gbe_file_exact:
errno = EIO;
return -1;