From 14ad5a981829750dbaca8f7dff1929c88fa18d79 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 7 Mar 2026 02:09:56 +0000 Subject: util/nvmutil: comment the unhandled errno exit Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index a3b176f5..3c59cd0c 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -236,6 +236,19 @@ main(int argc, char *argv[]) err(ECANCELED, "close '%s'", rname); #endif + /* + * We still exit with non-zero status if + * errno is set, but we don't need to print + * the error on dump commands, because they + * already print errors. + * + * If both parts have bad checksums, then + * cmd_dump will cause non-zero exit. If at + * least one part is valid, it resets errno. + * + * However, if we're not using cmd_dump, then + * we have a bug somewhere in the code. + */ if (cmd != cmd_dump) { if (errno) err(ECANCELED, "Unhandled error on exit"); -- cgit v1.2.1