summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-10-12 15:17:47 +0100
committerLeah Rowe <leah@libreboot.org>2023-10-12 15:17:47 +0100
commitf989360e88ab45bb20dd0415cc145f7d3ef42ee5 (patch)
treea3b5f75c236a7cb1a411c515c8df62bf9d69b70a /util/nvmutil
parent3ad171fd3dcb509c0b2e79b41ebd01494f67f46c (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index d2e84be..fe0df3d 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);
}