diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-10 10:53:11 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-10 10:53:11 +0000 |
| commit | e3e02fa65735c7eee77bf5c339af075fe85b8609 (patch) | |
| tree | 9dee987c9205ea49c86b5811f6043f94a7674327 /util/nvmutil/nvmutil.c | |
| parent | 6408570fa1945074cf1b389883befe0488cc02a6 (diff) | |
util/nvmutil: restore errno on failed offset restore
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 16dabedc..76cf23ca 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1390,8 +1390,11 @@ prw(int fd, void *mem, size_t count, if (r < 0) 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; + } if (r < 0) errno = saved_errno; |
