mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-21 10:12:04 +02:00
util/nvmutil: simplified exit error
no more command-specific logic here. this should be the same in the rest of the code now. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+3
-21
@@ -349,28 +349,10 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#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_index != CMD_DUMP) {
|
|
||||||
if (errno)
|
|
||||||
err(ECANCELED, "Unhandled error on exit");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (errno)
|
if (errno)
|
||||||
return EXIT_FAILURE;
|
err(ECANCELED, "Unhandled error on exit");
|
||||||
else
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user