From d21ac5838c446a75f77cf40fa3eabfac34a2611e Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Thu, 1 Jun 2023 23:32:19 -0700 Subject: [PATCH] Update redbean to add reporting for unpledged sigaction Previously it would abort without indicating what signal it failed to install when sigaction is not pledged (although it fails all of them). --- tool/net/redbean.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tool/net/redbean.c b/tool/net/redbean.c index 1b2db64bf..2affc80e2 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -7182,7 +7182,8 @@ static int WindowsReplThread(void *arg, int tid) { static void InstallSignalHandler(int sig, void *handler) { struct sigaction sa = {.sa_sigaction = handler}; - CHECK_NE(-1, sigaction(sig, &sa, 0)); + if (sigaction(sig, &sa, 0) == -1) + WARNF("(srvr) failed to set signal handler #%d: %m", sig); } static void SigInit(void) {