diff options
author | Vicent Marti <vicent@github.com> | 2014-02-18 18:48:43 +0100 |
---|---|---|
committer | Vicent Marti <vicent@github.com> | 2014-02-18 18:48:43 +0100 |
commit | e0ebaaa53ea1154a1f392dae463453ac6c428d78 (patch) | |
tree | 5be111f1c313d8a83ca6297354fb27c4cc768c6c /src/posix.h | |
parent | dbd2ca356b8a16d028e45c5263e9c460be13d338 (diff) | |
parent | 0197d4107a2996dc2ed4e98698e281c2d5fa44e1 (diff) | |
download | libgit2-e0ebaaa53ea1154a1f392dae463453ac6c428d78.tar.gz |
Merge pull request #2121 from bk2204/ewouldblock
Check for EWOULDBLOCK as well as EAGAIN on write.
Diffstat (limited to 'src/posix.h')
-rw-r--r-- | src/posix.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/posix.h b/src/posix.h index 6d3a84eba..f85b1aebd 100644 --- a/src/posix.h +++ b/src/posix.h @@ -29,6 +29,15 @@ #define O_CLOEXEC 0 #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; /** |