# HG changeset patch # User Kim Alvefur # Date 1537966629 -7200 # Node ID 5c8006ce8cb8ac86064d11972d68baea9d9cc137 # Parent 3260902a5b22d725ad287e202bebad1b4fada04d net.server_epoll: Include errno in log messages diff -r 3260902a5b22 -r 5c8006ce8cb8 net/server_epoll.lua --- a/net/server_epoll.lua Wed Sep 26 13:53:18 2018 +0200 +++ b/net/server_epoll.lua Wed Sep 26 14:57:09 2018 +0200 @@ -264,9 +264,9 @@ end if r == nil then r = self._wantread; end if w == nil then w = self._wantwrite; end - local ok, err = poll:add(fd, r, w); + local ok, err, errno = poll:add(fd, r, w); if not ok then - log("error", "Could not register %s: %s", self, err); + log("error", "Could not register %s: %s(%d)", self, err); return ok, err; end self._wantread, self._wantwrite = r, w; @@ -282,9 +282,9 @@ end if r == nil then r = self._wantread; end if w == nil then w = self._wantwrite; end - local ok, err = poll:set(fd, r, w); + local ok, err, errno = poll:set(fd, r, w); if not ok then - log("error", "Could not update poller state %s: %s", self, err); + log("error", "Could not update poller state %s: %s(%d)", self, err, errno); return ok, err; end self._wantread, self._wantwrite = r, w; @@ -299,9 +299,9 @@ if fds[fd] ~= self then return nil, "unregistered fd"; end - local ok, err = poll:del(fd); + local ok, err, errno = poll:del(fd); if not ok then - log("error", "Could not unregister %s: %s", self, err); + log("error", "Could not unregister %s: %s(%d)", self, err, errno); return ok, err; end self._wantread, self._wantwrite = nil, nil;