util/nvmutil: use set_err where appropriate

in the new file i/o functions, my own setting
of errno should be done with set_err. this
avoids clobbering what the real libc set.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-10 15:50:45 +00:00
parent 59eac512eb
commit 9691e7e7db
+2 -2
View File
@@ -703,7 +703,7 @@ xstrxcmp(const char *a, const char *b, size_t maxlen)
/*
* Should never reach here. This keeps compilers happy.
*/
errno = EINVAL;
set_err(EINVAL);
return -1;
}
@@ -1481,7 +1481,7 @@ prw(int fd, void *mem, size_t nrw,
else if (rw_type == PSCHREIB)
r = write(fd, mem, nrw);
else {
errno = EINVAL;
set_err(EINVAL);
return -1;
}
} while (r < 0 && errno == EINTR);