summaryrefslogtreecommitdiffstats
path: root/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/signal.c b/signal.c
index c833131b..4a089caf 100644
--- a/signal.c
+++ b/signal.c
@@ -130,6 +130,10 @@ val set_sig_handler(val signo, val lambda)
{
cnum sig = c_num(signo);
val old_lambda;
+ sigset_t block, saved;
+
+ sigfillset(&block);
+ sigprocmask(SIG_BLOCK, &block, &saved);
if (sig < 0 || sig >= MAX_SIG)
uw_throwf(error_s, lit("set-sig-handler: signal ~s out of range\n"), sig, nao);
@@ -159,6 +163,8 @@ val set_sig_handler(val signo, val lambda)
sig_lambda[sig] = lambda;
}
+ sigprocmask(SIG_SETMASK, &saved, 0);
+
return old_lambda;
}