Comparison

net/server_epoll.lua @ 9507:33d21f020b66

net.server_epoll: Ignore ENOENT when deregitering socket It should not really happen
author Kim Alvefur <zash@zash.se>
date Fri, 12 Oct 2018 03:21:11 +0200
parent 9506:ae6636052be9
child 9508:2055b497b515
comparison
equal deleted inserted replaced
9506:ae6636052be9 9507:33d21f020b66
25 local inet_pton = inet.pton; 25 local inet_pton = inet.pton;
26 local _SOCKETINVALID = socket._SOCKETINVALID or -1; 26 local _SOCKETINVALID = socket._SOCKETINVALID or -1;
27 27
28 local poller = require "util.poll" 28 local poller = require "util.poll"
29 local EEXIST = poller.EEXIST; 29 local EEXIST = poller.EEXIST;
30 local ENOENT = poller.ENOENT;
30 31
31 local poll = assert(poller.new()); 32 local poll = assert(poller.new());
32 33
33 local _ENV = nil; 34 local _ENV = nil;
34 -- luacheck: std none 35 -- luacheck: std none
308 end 309 end
309 if fds[fd] ~= self then 310 if fds[fd] ~= self then
310 return nil, "unregistered fd"; 311 return nil, "unregistered fd";
311 end 312 end
312 local ok, err, errno = poll:del(fd); 313 local ok, err, errno = poll:del(fd);
313 if not ok then 314 if not ok and errno ~= ENOENT then
314 log("error", "Could not unregister %s: %s(%d)", self, err, errno); 315 log("error", "Could not unregister %s: %s(%d)", self, err, errno);
315 return ok, err; 316 return ok, err;
316 end 317 end
317 self._wantread, self._wantwrite = nil, nil; 318 self._wantread, self._wantwrite = nil, nil;
318 fds[fd] = nil; 319 fds[fd] = nil;