aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/server_epoll.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index e85947ae..7d279035 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -246,6 +246,10 @@ function interface:setflags(r, w)
return true;
end
local fd = self:getfd();
+ if fd < 0 then
+ self._wantread, self._wantwrite = nil, nil;
+ return nil, "invalid fd";
+ end
local op = "mod";
if not flags then
op = "del";