diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-09 15:00:52 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-09 15:00:52 +0000 |
| commit | 2773736dfc50d6d947850c8ad1b6e9e5a1a779ab (patch) | |
| tree | 89a4f6ba0abb561cd1b2c34603768403df195626 /util/nvmutil/nvmutil.c | |
| parent | 62964b42edec3b1407e4567faeb0686948cd66bb (diff) | |
util/nvmutil: reset errno on urandom partial read
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |
