diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-04-01 06:17:25 +0100 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-04-01 06:17:25 +0100 |
| commit | df5bb1c8942befa32ab5fdae6235efd6da62e5b5 (patch) | |
| tree | 368693813424624e21e4aa642702fe0a55a4ad5b /util/libreboot-utils/lib/io.c | |
| parent | f90af15502dbcd4c3fb8df66b77f869d005978cd (diff) | |
libreboot-utils: loop fcntl on eintr
but i can't write a generic function for this,
because fcntl is a variadic function, so wrapping
cannot be done cleanly.
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 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/libreboot-utils/lib/io.c b/util/libreboot-utils/lib/io.c index 9bbf1f30..56f8528a 100644 --- a/util/libreboot-utils/lib/io.c +++ b/util/libreboot-utils/lib/io.c @@ -28,6 +28,8 @@ open_gbe_file(void) struct xstate *x = xstatus(); struct commands *cmd = &x->cmd[x->i]; struct xfile *f = &x->f; + int saved_errno = errno; + errno = 0; int _flags; @@ -46,7 +48,8 @@ open_gbe_file(void) if (f->gbe_st.st_nlink == 0) err_exit(EIO, "%s: file unlinked while open", f->fname); - _flags = fcntl(f->gbe_fd, F_GETFL); + while (fs_retry(saved_errno, + _flags = fcntl(f->gbe_fd, F_GETFL))); if (_flags == -1) err_exit(errno, "%s: fcntl(F_GETFL)", f->fname); @@ -74,6 +77,8 @@ open_gbe_file(void) if (lock_file(f->gbe_fd, cmd->flags) == -1) err_exit(errno, "%s: can't lock", f->fname); */ + + reset_caller_errno(0); } void |
