lbutils: simplify getprogname usage

the functions no longer return errors, so i don't
need to handle them.

furthermore, the handling in state.c is redundant,
so i've removed that too.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-29 09:30:10 +01:00
parent c2a70b7de0
commit 1539aff302
6 changed files with 5 additions and 18 deletions
-4
View File
@@ -77,9 +77,6 @@ xstart(int argc, char *argv[])
/* .f */
{0},
/* .argv0 (for our getprogname implementation) */
NULL,
/* ->i (index to cmd[]) */
0,
@@ -103,7 +100,6 @@ xstart(int argc, char *argv[])
us.f.buf = us.f.real_buf;
us.argv0 = argv[0];
us.f.fname = argv[1];
us.f.tmp_fd = -1;
+2 -6
View File
@@ -324,17 +324,13 @@ err_exit(int nvm_errval, const char *msg, ...)
if (!errno)
saved_errno = errno = ECANCELED;
if ((p = lbgetprogname()) != NULL)
fprintf(stderr, "%s: ", p);
fprintf(stderr, "%s: ", lbgetprogname());
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
if (p != NULL)
fprintf(stderr, ": %s\n", strerror(errno));
else
fprintf(stderr, "%s\n", strerror(errno));
fprintf(stderr, ": %s\n", strerror(errno));
exit(EXIT_FAILURE);
}