Merge pull request #102 from ansend/master

Retry read/write if EINTR is given instead of error-ing out.
This commit is contained in:
Joris Vink 2016-01-14 10:40:53 +01:00
commit bc6e46eb5f
1 changed files with 4 additions and 0 deletions

View File

@ -334,6 +334,8 @@ net_write(struct connection *c, int len, int *written)
if (r <= -1) {
switch (errno) {
case EINTR:
*written = 0;
return (KORE_RESULT_OK);
case EAGAIN:
c->flags &= ~CONN_WRITE_POSSIBLE;
return (KORE_RESULT_OK);
@ -357,6 +359,8 @@ net_read(struct connection *c, int *bytes)
if (r <= 0) {
switch (errno) {
case EINTR:
*bytes = 0;
return (KORE_RESULT_OK);
case EAGAIN:
c->flags &= ~CONN_READ_POSSIBLE;
return (KORE_RESULT_OK);