mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user