summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-14 06:21:58 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-14 06:21:58 +0000
commit4af9f431da537c13ac027835fbd62b837b0e616a (patch)
tree19aa5a1186489f56afa15da98b7859c02bf5cfee
parentb1725b6a84199bae910ce1cd61a7595ba4a886c0 (diff)
util/nvmutil: always restore saved errno
the last lseek there is only there to reset state, so its errors are irrelevant. Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 493970e1..e9046dc6 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1909,8 +1909,7 @@ try_rw_again:
saved_errno = errno;
if (lseek_loop(fd, off_orig, SEEK_SET,
loop_eagain, loop_eintr) == (off_t)-1) {
- if (r < 0)
- errno = saved_errno;
+ errno = saved_errno;
return -1;
}
errno = saved_errno;