util/nvmutil: skip errno check in main

skip it if there is a valid checksum, to mitigate
erroneous errno state upon exit from run_cmd(),
because we can assume by this point that we
are in fact ready to write at this point.

the check at the end still exists, which will catch
any error set by write, and any error set before
that. this fixes a weird warning on cmd_dump.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-10 16:06:13 +00:00
parent 13c759bf3a
commit c41483916a
+3 -2
View File
@@ -501,9 +501,10 @@ main(int argc, char *argv[])
errno = 0;
run_cmd(cmd_index);
if (errno)
if (errno && (!(part_valid[0] || part_valid[1])))
err(errno, "%s: Unhandled error (WRITE SKIPPED)", fname);
else if (command[cmd_index].flags == O_RDWR)
if (command[cmd_index].flags == O_RDWR)
write_gbe_file();
close_files();