summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/state.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-24 04:43:52 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-24 04:43:52 +0000
commit616099edade1d43893564177cbd31ff5f1c7eea0 (patch)
treeb671f2cc16df8dc4d0f3e78589935c7e9a3deaf1 /util/libreboot-utils/lib/state.c
parent61ee661b886508d158702f9925af02464e227c3a (diff)
util/nvmutil: make it compile again
i was reorganising the state machine (singleton) used for data, and part of what i wanted lead to mkhtemp being written. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/state.c')
-rw-r--r--util/libreboot-utils/lib/state.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/util/libreboot-utils/lib/state.c b/util/libreboot-utils/lib/state.c
index f9be230f..a3ad0f1e 100644
--- a/util/libreboot-utils/lib/state.c
+++ b/util/libreboot-utils/lib/state.c
@@ -105,14 +105,10 @@ xstart(int argc, char *argv[])
us.f.tmp_fd = -1;
us.f.tname = NULL;
+
if (new_tmpfile(&us.f.tmp_fd, &us.f.tname) < 0)
err_no_cleanup(errno, "%s", us.f.tname);
- /* parse user command */
-/* TODO: CHECK ACCESSES VIA xstatus() */
- set_cmd(argc, argv);
- set_cmd_args(argc, argv);
-
if (us.f.tname == NULL)
err_no_cleanup(errno, "x->f.tname null");
if (*us.f.tname == '\0')
@@ -138,8 +134,6 @@ xstatus(void)
if (x == NULL)
err_no_cleanup(EACCES, "NULL pointer to xstate");
- sanitize_command_list();
-
return x;
}
@@ -180,10 +174,11 @@ getnvmprogname(void)
char *rval = fallback;
if (x != NULL) {
- if (x->argv0 == NULL || *x->argv0 == '\0')
- return "";
- rval = x->argv0;
+ if (x->argv0 != NULL && *x->argv0 != '\0')
+ rval = x->argv0;
+ else
+ return fallback;
}
p = strrchr(rval, '/');