From 8089f6f58c2f2705729dd63dd6437fc702490140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Thu, 8 Aug 2024 17:44:29 +0000 Subject: [PATCH] [libedit] Register signal handler with SA_ONSTACK flag. This allows the handler to use the alternate signal stack if one is available in the handling thread, but has no effect otherwise. This change makes the signal handler respect existing choices better. Specifically, this allows signal handlers to be set when the process includes a Go runtime, since Go enforces that _all_ signal handlers in the process use the SA_ONSTACK flag (e.g. see https://github.com/golang/go/issues/20400). --- lib/libedit/sig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libedit/sig.c b/lib/libedit/sig.c index 7e74869802530..3dcf6d25f8e07 100644 --- a/lib/libedit/sig.c +++ b/lib/libedit/sig.c @@ -167,7 +167,7 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; - nsa.sa_flags = 0; + nsa.sa_flags = SA_ONSTACK; sigemptyset(&nsa.sa_mask); sel = el;