mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
libreboot-utils: don't loop lseek on EINTR
not necessary. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -465,8 +465,6 @@ int io_args(int fd, void *mem, size_t nrw,
|
|||||||
off_t off, int rw_type);
|
off_t off, int rw_type);
|
||||||
int check_file(int fd, struct stat *st);
|
int check_file(int fd, struct stat *st);
|
||||||
ssize_t rw_over_nrw(ssize_t r, size_t nrw);
|
ssize_t rw_over_nrw(ssize_t r, size_t nrw);
|
||||||
off_t lseek_on_eintr(int fd, off_t off,
|
|
||||||
int whence);
|
|
||||||
int off_retry(int saved_errno, off_t rval);
|
int off_retry(int saved_errno, off_t rval);
|
||||||
int sys_retry(int saved_errno, long rval);
|
int sys_retry(int saved_errno, long rval);
|
||||||
int fs_retry(int saved_errno, int rval);
|
int fs_retry(int saved_errno, int rval);
|
||||||
|
|||||||
@@ -608,7 +608,7 @@ open_file_on_eintr(const char *path,
|
|||||||
exitf("%s: not a regular file", path);
|
exitf("%s: not a regular file", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lseek_on_eintr(*fd, 0, SEEK_CUR) == (off_t)-1)
|
if (lseek(*fd, 0, SEEK_CUR) == (off_t)-1)
|
||||||
exitf("%s: file not seekable", path);
|
exitf("%s: file not seekable", path);
|
||||||
|
|
||||||
errno = saved_errno; /* see previous comment */
|
errno = saved_errno; /* see previous comment */
|
||||||
@@ -670,20 +670,6 @@ openat_on_eintr(int dirfd, const char *path,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
off_t
|
|
||||||
lseek_on_eintr(int fd, off_t off, int whence)
|
|
||||||
{
|
|
||||||
int saved_errno = errno;
|
|
||||||
off_t rval = 0;
|
|
||||||
errno = 0;
|
|
||||||
|
|
||||||
while (off_retry(saved_errno,
|
|
||||||
rval = lseek(fd, off, whence)));
|
|
||||||
|
|
||||||
reset_caller_errno(rval);
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
mkdirat_on_eintr(int dirfd,
|
mkdirat_on_eintr(int dirfd,
|
||||||
const char *path, mode_t mode)
|
const char *path, mode_t mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user