summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c13
1 files changed, 13 insertions, 0 deletions
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");