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>
This commit is contained in:
Leah Rowe
2026-03-08 15:07:29 +00:00
parent 1d630f8e36
commit b5054f68ba
+5 -1
View File
@@ -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);