util/nvmutil: re-add cleanup

delete tmpfiles after operation. fixes a bug where
tmpfiles are left behind after running the dump
command.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-29 14:37:51 +01:00
parent e4016eb32c
commit 8657d084d2
+18 -1
View File
@@ -95,5 +95,22 @@ main(int argc, char *argv[])
static void
exit_cleanup(void)
{
return;
struct xstate *x;
struct xfile *f;
x = xstatus();
if (x == NULL)
return;
f = &x->f;
/* close fds if still open */
close_on_eintr(&f->tmp_fd);
close_on_eintr(&f->gbe_fd);
/* unlink tmpfile if it exists */
if (f->tname != NULL) {
(void) unlink(f->tname);
free_and_set_null(&f->tname);
}
}