util/nvmutil: use EXIT_FAILURE/SUCCESS for exits

this, in conjunction with the centralised exit scheme now
used by nvmutil, means that we have portable exit status.

notwithstanding the use of non-portable unix functions, and
especially the use of non-standard err.c (which GNU and BSD
libc implementations all have anyway, as does musl).

this code should now run on essentially any computer with
Linux or BSD on it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-03 03:43:06 +00:00
parent e4b8bb4875
commit c721d6f4f4
+2 -2
View File
@@ -92,7 +92,7 @@ main(int argc, char *argv[])
writeGbe(); writeGbe();
err_if((errno != 0) && (cmd != cmd_dump)); err_if((errno != 0) && (cmd != cmd_dump));
return errno ? 1 : 0; return errno ? EXIT_FAILURE : EXIT_SUCCESS;
} }
void void
@@ -488,5 +488,5 @@ int
set_err(int x) set_err(int x)
{ {
errno = errno ? errno : x; errno = errno ? errno : x;
return 1; return EXIT_FAILURE;
} }