diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-13 23:02:26 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:41 +0000 |
| commit | 2a83a8ec438b9b523643f02b274cdc3966a36cd4 (patch) | |
| tree | 79ccdcf70f81ea3b3cdeda6eef8abaefd7815531 /util/nvmutil/nvmutil.c | |
| parent | 935d082a512d8140142e2b0317bdecd8f38cb732 (diff) | |
util/nvmutil: properly reset lseek on error
don't return. set r instead. this will fall through
and return the same way, but with proper reset.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 68627d3a..901ba9a4 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1719,10 +1719,9 @@ try_rw_again: goto err_prw; if ((off_orig = lseek_eintr(fd, (off_t)0, SEEK_CUR)) == (off_t)-1) - return -1; - - if (lseek_eintr(fd, off, SEEK_SET) == (off_t)-1) - return -1; + r = -1; + else if (lseek_eintr(fd, off, SEEK_SET) == (off_t)-1) + r = -1; do { if (rw_type == IO_PREAD) |
