From 3d27c77a63773bae8e8153434769eba7c4925acc Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 4 Mar 2026 00:52:40 +0000 Subject: util/nvmutil: reset errno on successful file reads a non-fatal error could have set errno. when we return from check_read_or_die(), it should be assumed that all is well. i don't think this would mask anything important, but it may be regarded as a preventative bug fix, since it most likely only prevents false-positives. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 46714a23..175683a5 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -432,8 +432,10 @@ static int check_read_or_die(const char *rpath, ssize_t rval, size_t rsize, int retry, const char *readtype) { - if (rval == (ssize_t) rsize) + if (rval == (ssize_t) rsize) { + errno = 0; return 1; /* Successful read */ + } if (rval != -1) err(ECANCELED, "Short %s, %zd bytes, on file: %s", -- cgit v1.2.1