mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 13:16:47 +02:00
util/nvmutil: restore errno on failed offset restore
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1390,8 +1390,11 @@ prw(int fd, void *mem, size_t count,
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
saved_errno = errno;
|
saved_errno = errno;
|
||||||
|
|
||||||
if (lseek_eintr(fd, old, SEEK_SET) == (off_t)-1)
|
if (lseek_eintr(fd, old, SEEK_SET) == (off_t)-1) {
|
||||||
|
if (saved_errno)
|
||||||
|
errno = saved_errno;
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
|
|||||||
Reference in New Issue
Block a user