From 761643abcc02b20378d0e71ed6dbeef90d858e7e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 24 Feb 2024 01:00:44 +0100 Subject: util.signal: Wrap signalfd in an userdatum for gc handling etc --- net/server_epoll.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'net') diff --git a/net/server_epoll.lua b/net/server_epoll.lua index a064dcfa..127d049e 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -1147,12 +1147,13 @@ end local hook_signal; if have_signal and signal.signalfd then local function dispatch(self) - return self:on("signal", signal.signalfd_read(self:getfd())); + return self:on("signal", self.conn:read()); end function hook_signal(signum, cb) local watch = watchfd(signal.signalfd(signum), dispatch); watch.listeners = { onsignal = cb }; + watch.close = nil; -- revert to default return watch; end end -- cgit v1.2.3