diff options
Diffstat (limited to 'util/libreboot-utils/lib/state.c')
| -rw-r--r-- | util/libreboot-utils/lib/state.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util/libreboot-utils/lib/state.c b/util/libreboot-utils/lib/state.c index e3cb0890..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) < 0) - err_no_cleanup(errno, "%s", us.f.tname); + if (new_tmpfile(&us.f.tmp_fd, &us.f.tname, dir, ".gbe.XXXXXXXXXX") < 0) + 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,13 +164,13 @@ 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; } void -err(int nvm_errval, const char *msg, ...) +b0rk(int nvm_errval, const char *msg, ...) { struct xstate *x = xstatus(); |
