summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-08 15:07:29 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-08 15:07:29 +0000
commitb5054f68bae37facdc839c7f616939736847f3cc (patch)
tree3c390d0f8c80871e345352b0a33285f14797d286
parent1d630f8e36effef914235ca9a891e4880612a034 (diff)
util/nvmutil: don't write gbe file if errno set
nice bit of defense here we absolutely need this code to be bullet proof Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index cd3d3650..9d2c50c9 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -292,7 +292,11 @@ main(int argc, char *argv[])
read_gbe_file();
run_cmd(cmd_index);
- write_gbe_file();
+
+ if (errno)
+ err(errno, "Unhandled error: will not write file: %s", fname);
+ else
+ write_gbe_file();
if (close(gbe_fd) == -1)
err(ECANCELED, "close '%s'", fname);