util.signal: Fail signalfd() if unable to change signal mask
By aborting early, the failure should be brought to the attention
somehow.
--- a/util-src/signal.c Wed Feb 28 22:24:09 2024 +0100
+++ b/util-src/signal.c Wed Feb 28 22:31:06 2024 +0100
@@ -384,7 +384,10 @@
sigemptyset(&sfd->mask);
sigaddset(&sfd->mask, luaL_checkinteger(L, 1));
- sigprocmask(SIG_BLOCK, &sfd->mask, NULL); /* TODO check err */
+ if (sigprocmask(SIG_BLOCK, &sfd->mask, NULL) != 0) {
+ lua_pushnil(L);
+ return 1;
+ };
sfd->fd = signalfd(-1, &sfd->mask, SFD_NONBLOCK);