net.server_epoll: Log failure to hook signals
To make any such failures noticeable
--- 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;