Changeset

9508:2055b497b515

net.server_epoll: Special handling of signal interrupts
author Kim Alvefur <zash@zash.se>
date Fri, 12 Oct 2018 03:22:09 +0200
parents 9507:33d21f020b66
children 9509:b57353f76c83
files net/server_epoll.lua util-src/poll.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Fri Oct 12 03:21:11 2018 +0200
+++ b/net/server_epoll.lua	Fri Oct 12 03:22:09 2018 +0200
@@ -742,7 +742,7 @@
 				log("debug", "Removing unknown fd %d", fd);
 				poll:del(fd);
 			end
-		elseif r ~= "timeout" then
+		elseif r ~= "timeout" and r ~= "signal" then
 			log("debug", "epoll_wait error: %s[%d]", r, w);
 		end
 	until once or (quitting and next(fds) == nil);
--- a/util-src/poll.c	Fri Oct 12 03:21:11 2018 +0200
+++ b/util-src/poll.c	Fri Oct 12 03:22:09 2018 +0200
@@ -316,6 +316,11 @@
 		lua_pushstring(L, "timeout");
 		return 2;
 	}
+	else if(ret < 0 && errno == EINTR) {
+		lua_pushnil(L);
+		lua_pushstring(L, "signal");
+		return 2;
+	}
 	else if(ret < 0) {
 		ret = errno;
 		lua_pushnil(L);