POSIX.1-2001 defines the value of EWOULDBLOCK and EAGAIN can be different - sob… | |
git clone git://git.codemadness.org/sob | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 74676ddd350816d7c6bdd5ef274a8c66ae49d105 | |
parent fbf256e42d9229923c4e8e15974966efd6bc6384 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Sat, 25 Oct 2014 15:28:47 +0000 | |
POSIX.1-2001 defines the value of EWOULDBLOCK and EAGAIN can be different | |
Diffstat: | |
M sob.c | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/sob.c b/sob.c | |
@@ -557,7 +557,7 @@ readfd(int fd, char *buf, size_t len) { | |
if((r = read(fd, &buf[i], len)) == -1) { | |
if(errno == EINTR) | |
continue; | |
- if(errno == EWOULDBLOCK) | |
+ if(errno == EWOULDBLOCK || errno == EAGAIN) | |
return i; | |
return -1; | |
} else if(r == 0) { | |
@@ -577,7 +577,7 @@ writefd(int fd, char *buf, size_t len) { | |
if((w = write(fd, &buf[i], len)) == -1) { | |
if(errno == EINTR) | |
continue; | |
- if(errno == EWOULDBLOCK) | |
+ if(errno == EWOULDBLOCK || errno == EAGAIN) | |
return i; | |
return -1; | |
} else if(w == 0) { |