aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2024-02-24 01:00:44 +0100
committerKim Alvefur <zash@zash.se>2024-02-24 01:00:44 +0100
commit761643abcc02b20378d0e71ed6dbeef90d858e7e (patch)
treeaca1179cc86b04d96d4e34757a7666030d1826fe /net
parent49c296360d8314cabf2aef48907488c109926ae3 (diff)
downloadprosody-761643abcc02b20378d0e71ed6dbeef90d858e7e.tar.gz
prosody-761643abcc02b20378d0e71ed6dbeef90d858e7e.zip
util.signal: Wrap signalfd in an userdatum for gc handling etc
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua3
1 files changed, 2 insertions, 1 deletions
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