diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-07 02:09:56 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-07 02:09:56 +0000 |
| commit | 14ad5a981829750dbaca8f7dff1929c88fa18d79 (patch) | |
| tree | 41a478438f07bb78dcdf99aa0d85efee35f0173a /util/nvmutil | |
| parent | 90bd395cb101ca32566b68b6deafe25797d1a24e (diff) | |
util/nvmutil: comment the unhandled errno exit
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 13 |
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"); |
