From 883860d6874816f6788adedab5f53b4eae3c0bf2 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 10 Mar 2026 14:10:45 +0000 Subject: 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 --- util/nvmutil/nvmutil.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'util/nvmutil') 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; } } -- cgit v1.2.1