diff options
author | Emil Renner Berthing <esmil@mailme.dk> | 2013-01-27 11:41:08 +0100 |
---|---|---|
committer | Emil Renner Berthing <esmil@mailme.dk> | 2013-01-27 17:32:14 +0100 |
commit | 868f573430113b9fcf751370acaa486d064a08d3 (patch) | |
tree | 6bde4cfeda118e38df0a7a64fef0ff93b251fde9 | |
parent | af89ca0fbbb10beaf81cd7f8f36345802ce9476c (diff) | |
download | lem-868f573430113b9fcf751370acaa486d064a08d3.tar.gz lem-868f573430113b9fcf751370acaa486d064a08d3.tar.xz lem-868f573430113b9fcf751370acaa486d064a08d3.zip |
io: try syscalls again on EINTR
-rw-r--r-- | lem/io/server.c | 4 | ||||
-rw-r--r-- | lem/io/stream.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lem/io/server.c b/lem/io/server.c index 482d32a..7ed0319 100644 --- a/lem/io/server.c +++ b/lem/io/server.c @@ -99,7 +99,7 @@ server__accept(lua_State *T, struct ev_io *w, int mt) int sock = accept(w->fd, NULL, NULL); if (sock < 0) { - if (errno == EAGAIN || errno == ECONNABORTED) + if (errno == EAGAIN || errno == EINTR || errno == ECONNABORTED) return 0; lua_pushnil(T); @@ -182,7 +182,7 @@ server_autospawn_cb(EV_P_ struct ev_io *w, int revents) /* dequeue the incoming connection */ sock = accept(w->fd, NULL, NULL); if (sock < 0) { - if (errno == EAGAIN || errno == ECONNABORTED) + if (errno == EAGAIN || errno == EINTR || errno == ECONNABORTED) return; lua_pushnil(T); lua_pushfstring(T, "error accepting connection: %s", diff --git a/lem/io/stream.c b/lem/io/stream.c index 1280db9..b988278 100644 --- a/lem/io/stream.c +++ b/lem/io/stream.c @@ -115,7 +115,7 @@ stream__readp(lua_State *T, struct stream *s) err = errno; lem_debug("read %ld bytes from %d", bytes, s->r.fd); - if (bytes < 0 && err == EAGAIN) + if (bytes < 0 && (err == EAGAIN || err == EINTR)) return 0; if (bytes == 0 || err == ECONNRESET || err == EPIPE) @@ -221,7 +221,7 @@ stream__write(lua_State *T, struct stream *s) } err = errno; - if (bytes < 0 && err == EAGAIN) + if (bytes < 0 && (err == EAGAIN || err == EINTR)) return 0; s->open = 0; |