From 2773736dfc50d6d947850c8ad1b6e9e5a1a779ab Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 9 Mar 2026 15:00:52 +0000 Subject: util/nvmutil: reset errno on urandom partial read Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 8bad10d2..7643cf1d 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -962,8 +962,10 @@ read_gbe_file_exact(int fd, void *buf, size_t len, * the smaller amount of bytes and call * read_gbe_file_exact again if necessary. */ - if (rval > 0) + if (rval > 0) { + errno = 0; return rval; + } } err(ECANCELED, @@ -979,6 +981,7 @@ read_gbe_file_exact(int fd, void *buf, size_t len, err(EINTR, "%s: max retries exceeded on file: %s", op ? op : "read", path); + return -1; } -- cgit v1.2.1