summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/state.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-25 00:03:31 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-25 00:03:31 +0000
commitf06db344ad53c987e38970b55e119a5af36641e1 (patch)
treedc3ae6c5ac3ae9b37d4cb3fc32f6d7e480d3c78c /util/libreboot-utils/lib/state.c
parent3ddd7a0d36ef5f3d98f6e25efbdaf479d66cc35a (diff)
mkhtemp: fix err()
calling it indirectly was out of the question. must call it directly. 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.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/util/libreboot-utils/lib/state.c b/util/libreboot-utils/lib/state.c
index 4ef7163f..42d060b7 100644
--- a/util/libreboot-utils/lib/state.c
+++ b/util/libreboot-utils/lib/state.c
@@ -98,9 +98,9 @@ xstart(int argc, char *argv[])
return &us;
if (argc < 3)
- err_no_cleanup(EINVAL, "xstart: Too few arguments");
+ err_no_cleanup(0, EINVAL, "xstart: Too few arguments");
if (argv == NULL)
- err_no_cleanup(EINVAL, "xstart: NULL argv");
+ err_no_cleanup(0, EINVAL, "xstart: NULL argv");
first_run = 0;
@@ -113,41 +113,41 @@ xstart(int argc, char *argv[])
us.f.tname = NULL;
if ((realdir = realpath(us.f.fname, NULL)) == NULL)
- err_no_cleanup(errno, "xstart: can't get realpath of %s",
+ err_no_cleanup(0, errno, "xstart: can't get realpath of %s",
us.f.fname);
if (fs_dirname_basename(realdir, &dir, &base, 0) < 0)
- err_no_cleanup(errno, "xstart: don't know CWD of %s",
+ err_no_cleanup(0, errno, "xstart: don't know CWD of %s",
us.f.fname);
if ((us.f.base = strdup(base)) == NULL)
- err_no_cleanup(errno, "strdup base");
+ err_no_cleanup(0, errno, "strdup base");
us.f.dirfd = fs_open(dir,
O_RDONLY | O_DIRECTORY);
if (us.f.dirfd < 0)
- err_no_cleanup(errno, "%s: open dir", dir);
+ err_no_cleanup(0, errno, "%s: open dir", dir);
if (new_tmpfile(&us.f.tmp_fd, &us.f.tname, dir, ".gbe.XXXXXXXXXX") < 0)
- err_no_cleanup(errno, "%s", us.f.tname);
+ err_no_cleanup(0, errno, "%s", us.f.tname);
if (fs_dirname_basename(us.f.tname,
&tmpdir, &tmpbase_local, 0) < 0)
- err_no_cleanup(errno, "tmp basename");
+ err_no_cleanup(0, errno, "tmp basename");
us.f.tmpbase = strdup(tmpbase_local);
if (us.f.tmpbase == NULL)
- err_no_cleanup(errno, "strdup tmpbase");
+ err_no_cleanup(0, errno, "strdup tmpbase");
free_if_null(&tmpdir);
if (us.f.tname == NULL)
- err_no_cleanup(errno, "x->f.tname null");
+ err_no_cleanup(0, errno, "x->f.tname null");
if (*us.f.tname == '\0')
- err_no_cleanup(errno, "x->f.tname empty");
+ err_no_cleanup(0, errno, "x->f.tname empty");
if (fstat(us.f.tmp_fd, &us.f.tmp_st) < 0)
- err_no_cleanup(errno, "%s: stat", us.f.tname);
+ err_no_cleanup(0, errno, "%s: stat", us.f.tname);
memset(us.f.real_buf, 0, sizeof(us.f.real_buf));
memset(us.f.bufcmp, 0, sizeof(us.f.bufcmp));
@@ -164,7 +164,7 @@ xstatus(void)
struct xstate *x = xstart(0, NULL);
if (x == NULL)
- err_no_cleanup(EACCES, "NULL pointer to xstate");
+ err_no_cleanup(0, EACCES, "NULL pointer to xstate");
return x;
}