mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Only use pread64 on Linux
This commit is contained in:
parent
a00d61d921
commit
591bbcbb63
@ -748,9 +748,13 @@ pread_all(PyObject *self, PyObject *args) {
|
||||
break;
|
||||
}
|
||||
#else
|
||||
#ifdef __linux__
|
||||
ssize_t nr = pread64(fd, buf + pos, n - pos, offset);
|
||||
#else
|
||||
ssize_t nr = pread(fd, buf + pos, n - pos, offset);
|
||||
#endif
|
||||
if (nr < 0) {
|
||||
if (errno == EINTR || errno == EAGAIN || errno == EBUSY) continue;
|
||||
if (errno == EINTR || errno == EAGAIN) continue;
|
||||
saved_errno = errno;
|
||||
break;
|
||||
} else if (nr == 0) break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user