diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-03 22:59:38 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-03 23:00:17 +0000 |
| commit | 75bcc46de43b903f043ad8bdf94ee3c7108a546a (patch) | |
| tree | 737dc0bbd02d39f8b8eff9ac5a7286c98dec803d | |
| parent | 7a62ad3f62df6c51c51f958d32711f7b371b7140 (diff) | |
util/nvmutil: comment valid_read for clarity
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 59274f07..0ccf6ff0 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -383,7 +383,8 @@ static int valid_read(const char *rpath, ssize_t rval, size_t rsize, int retry) { if (rval == (ssize_t) rsize) - return 1; + return 1; /* Successful read */ + if (rval != -1) err(ECANCELED, "Short read, %zd: %s", rval, rpath); if (errno != EINTR) @@ -391,6 +392,10 @@ valid_read(const char *rpath, ssize_t rval, size_t rsize, int retry) if (retry == MAX_RETRY_READ - 1) err(EINTR, "read: max retries exceeded: %s", rpath); + /* + * Bad read, with errno EINTR (syscall interrupted). + * Reset the error state and try again. + */ errno = 0; return 0; } |
