mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-19 09:32:27 +02:00
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:
@@ -703,7 +703,7 @@ xstrxcmp(const char *a, const char *b, size_t maxlen)
|
|||||||
/*
|
/*
|
||||||
* Should never reach here. This keeps compilers happy.
|
* Should never reach here. This keeps compilers happy.
|
||||||
*/
|
*/
|
||||||
errno = EINVAL;
|
set_err(EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1481,7 +1481,7 @@ prw(int fd, void *mem, size_t nrw,
|
|||||||
else if (rw_type == PSCHREIB)
|
else if (rw_type == PSCHREIB)
|
||||||
r = write(fd, mem, nrw);
|
r = write(fd, mem, nrw);
|
||||||
else {
|
else {
|
||||||
errno = EINVAL;
|
set_err(EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} while (r < 0 && errno == EINTR);
|
} while (r < 0 && errno == EINTR);
|
||||||
|
|||||||
Reference in New Issue
Block a user