summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-10 11:24:11 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-10 11:25:27 +0000
commitbbe6de44e80352cb12c89a0e925d85d6c276d869 (patch)
treed69546da6d49fc66d3465461a072c12ea0103798 /util/nvmutil
parent5603fa51d244eedfb7a7cbb60692d18eaf81b432 (diff)
util/nvmutil: stricter errno on prw()
we want the first error to be the one shown, when returning negative Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index aecd2067..65da82e4 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1384,7 +1384,6 @@ prw(int fd, void *mem, size_t count,
{
off_t old;
ssize_t r;
- int restore_errno;
int saved_errno = 0;
if ((old = lseek_eintr(fd, (off_t)0, SEEK_CUR)) == (off_t)-1)
@@ -1405,13 +1404,9 @@ prw(int fd, void *mem, size_t count,
if (r < 0)
saved_errno = errno;
- restore_errno = errno;
-
if (lseek_eintr(fd, old, SEEK_SET) == (off_t)-1) {
if (saved_errno)
errno = saved_errno;
- else
- errno = restore_errno;
return -1;
}