mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 15:00:04 +00:00
Merge pull request #2121 from bk2204/ewouldblock
Check for EWOULDBLOCK as well as EAGAIN on write.
This commit is contained in:
commit
e0ebaaa53e
@ -189,7 +189,7 @@ int p_write(git_file fd, const void *buf, size_t cnt)
|
|||||||
r = write(fd, b, cnt);
|
r = write(fd, b, cnt);
|
||||||
#endif
|
#endif
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
if (errno == EINTR || errno == EAGAIN)
|
if (errno == EINTR || GIT_ISBLOCKED(errno))
|
||||||
continue;
|
continue;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,15 @@
|
|||||||
#define O_CLOEXEC 0
|
#define O_CLOEXEC 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Determine whether an errno value indicates that a read or write failed
|
||||||
|
* because the descriptor is blocked.
|
||||||
|
*/
|
||||||
|
#if defined(EWOULDBLOCK)
|
||||||
|
#define GIT_ISBLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
|
||||||
|
#else
|
||||||
|
#define GIT_ISBLOCKED(e) ((e) == EAGAIN)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef int git_file;
|
typedef int git_file;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user