From cce396a1ac3786b18f2c21d80c4e65e19481510d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 24 Mar 2026 07:41:45 +0000 Subject: libreboot-utils: general code cleanup Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/state.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'util/libreboot-utils/lib/state.c') diff --git a/util/libreboot-utils/lib/state.c b/util/libreboot-utils/lib/state.c index a3ad0f1e..b7701f0d 100644 --- a/util/libreboot-utils/lib/state.c +++ b/util/libreboot-utils/lib/state.c @@ -204,28 +204,13 @@ exit_cleanup(void) if (x != NULL) { f = &x->f; - if (f->gbe_fd > -1) { - if (close_on_eintr(f->gbe_fd) == -1) { - f->gbe_fd = -1; - close_err = 1; - } - f->gbe_fd = -1; - } - - if (f->tmp_fd > -1) { - if (close_on_eintr(f->tmp_fd) == -1) { - f->tmp_fd = -1; - close_err = 1; - } - f->tmp_fd = -1; - } + close_no_err(&f->gbe_fd); + close_no_err(&f->tmp_fd); + close_no_err(&f->tmp_fd); - if (f->tname != NULL) { + if (f->tname != NULL) if (unlink(f->tname) == -1) close_err = 1; - } - - f->tmp_fd = -1; } if (saved_errno) -- cgit v1.2.1