diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-28 08:32:27 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-28 08:32:27 +0000 |
| commit | 4ecdadb7a601b0613e65bf8547d17b39ed87153f (patch) | |
| tree | 2f29c2b6adc0b2891ceed08541b8c4645df2c413 /util/libreboot-utils/lib/io.c | |
| parent | 49cac232d8e3cc6147a530d4f7971832f6b869b5 (diff) | |
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/io.c')
| -rw-r--r-- | util/libreboot-utils/lib/io.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/util/libreboot-utils/lib/io.c b/util/libreboot-utils/lib/io.c index f69954c8..d3f5733d 100644 --- a/util/libreboot-utils/lib/io.c +++ b/util/libreboot-utils/lib/io.c @@ -439,10 +439,8 @@ gbe_mv(void) tmp_gbe_bin_exists = 0; ret_gbe_mv: - if (f->gbe_fd > -1) { close_on_eintr(&f->gbe_fd); - f->gbe_fd = -1; if (fsync_dir(f->fname) < 0) { f->io_err_gbe_bin = 1; @@ -462,17 +460,12 @@ ret_gbe_mv: tmp_gbe_bin_exists = 0; } - if (rval < 0) { - /* if nothing set errno, - * we assume EIO, or we - * use what was set - */ - if (errno == saved_errno) - errno = EIO; - } else { - errno = saved_errno; - } + if (rval >= 0) + goto out; + return set_errno(saved_errno, EIO); +out: + errno = saved_errno; return rval; } |
