Software /
code /
prosody
Changeset
13447:5c9df28a57bb
net.server_epoll: Log failure to hook signals
To make any such failures noticeable
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 28 Feb 2024 22:24:09 +0100 |
parents | 13446:dba7073f1452 |
children | 13448:93b4ce0115f0 |
files | net/server_epoll.lua |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/net/server_epoll.lua Tue Feb 27 17:15:36 2024 +0100 +++ b/net/server_epoll.lua Wed Feb 28 22:24:09 2024 +0100 @@ -1151,7 +1151,12 @@ end function hook_signal(signum, cb) - local watch = watchfd(signal.signalfd(signum), dispatch); + local sigfd = signal.signalfd(signum); + if not sigfd then + log("error", "Could not hook signal %d", signum); + return nil, "failed"; + end + local watch = watchfd(sigfd, dispatch); watch.listeners = { onsignal = cb }; watch.close = nil; -- revert to default return watch;