From f989360e88ab45bb20dd0415cc145f7d3ef42ee5 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 12 Oct 2023 15:17:47 +0100 Subject: nvmutil: reset errno on successful write previously, a bad checksum would have caused a non-zero exit, even if the other checksum was correct (observed when using the swap command) Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 1 + 1 file changed, 1 insertion(+) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index d2e84be8..fe0df3d1 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -269,5 +269,6 @@ writeGbeFile(void) handle_endianness(p^x); err_if(pwrite(fd, (uint8_t *) gbe[p^x], nf, p << 12) == -1); } + errno = 0; err_if(close(fd) == -1); } -- cgit v1.2.1