mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-13 06:49:52 +02:00
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 <leah@libreboot.org>
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user