diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-10 14:10:45 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-10 14:12:45 +0000 |
| commit | 883860d6874816f6788adedab5f53b4eae3c0bf2 (patch) | |
| tree | 2027c9f9d3e3edd2763fc9a3fc05215124868711 | |
| parent | 6eefd80efe11112bd5b32083a797f153de226ad4 (diff) | |
util/nvmutil: reset rw_file_exact errno on EINTR
this is essentially what it already did, but it
wasn't explicitly stated. now it's clearer.
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index aa795b26..5de1f35f 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1390,7 +1390,15 @@ rw_file_exact(int fd, uint8_t *mem, size_t len, if (errno != EINTR) err(EIO, "%s: %s", path, rw_type_str); - errno = 0; + /* + * EINTR is not fatal, because we + * eventually return. We rely on + * errno for general error state + * after return from rw_file_exact, + * so we don't want a false error. + */ + if (errno == EINTR) + errno = 0; } } |
