mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil: stricter lseep_loop return offset
we currently reset just fine, but a partial success where the previous offset is not the same as the original should also be considered failure. this patch therefore makes the return much stricter, making the code return an error if this occurs, which in nvmutil would then cause a program exit. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -2107,14 +2107,15 @@ real_pread_pwrite:
|
||||
}
|
||||
|
||||
saved_errno = errno;
|
||||
|
||||
off_last = lseek_loop(fd, off_orig, SEEK_SET,
|
||||
loop_eagain, loop_eintr);
|
||||
if (off_last == (off_t)-1) {
|
||||
|
||||
if (off_last != off_orig) {
|
||||
errno = saved_errno;
|
||||
return -1;
|
||||
}
|
||||
if (off_last != off_orig)
|
||||
goto err_prw;
|
||||
}
|
||||
|
||||
errno = saved_errno;
|
||||
|
||||
return rw_over_nrw(r, nrw);
|
||||
|
||||
Reference in New Issue
Block a user