diff options
| -rw-r--r-- | util/nvmutil/nvmutil.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index bff8bab0..6cb11d55 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -301,6 +301,8 @@ read_gbe_part(int p, int invert) if (errno) err(errno, "Unhandled error on read of file '%s'", fname); + if (rval != (ssize_t) SIZE_4KB) + err(ECANCELED, "Unknown error on read of file '%s'", fname); swap(p ^ invert); /* handle big-endian host CPU */ } @@ -426,6 +428,8 @@ read_urandom(uint8_t *rnum, size_t rsize) if (errno) err(errno, "Unhandled error on read of file '/dev/urandom'"); + if (rval != (ssize_t) rsize) + err(ECANCELED, "Unknown error on read of file '/dev/urandom'"); } static int |
