mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil prw: always restore original offset
it currently only does so on success, but errors will leave the file descriptor corrupted. reset it accordingly. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1388,10 +1388,8 @@ prw(int fd, void *mem, size_t count,
|
||||
err(EIO, "%s: Invalid rw_type", path);
|
||||
} while (r < 0 && errno == EINTR);
|
||||
|
||||
if (r >= 0) {
|
||||
if (lseek_eintr(fd, old, SEEK_SET) == (off_t)-1)
|
||||
return -1;
|
||||
}
|
||||
if (lseek_eintr(fd, old, SEEK_SET) == (off_t)-1)
|
||||
return -1;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user