From bbe6de44e80352cb12c89a0e925d85d6c276d869 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 10 Mar 2026 11:24:11 +0000 Subject: util/nvmutil: stricter errno on prw() we want the first error to be the one shown, when returning negative Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'util/nvmutil') 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; } -- cgit v1.2.1