From c41483916a80c9d54695c5657df1fac913d79826 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 10 Mar 2026 16:06:13 +0000 Subject: 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 --- util/nvmutil/nvmutil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 010349e9..564f8f19 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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(); -- cgit v1.2.1