Module Name: src Committed By: christos Date: Wed Dec 18 15:38:52 UTC 2024
Modified Files: src/lib/libedit: sig.c Log Message: >From tkoeppe@github: Specify SA_ONSTACK when setting up a signal handler. 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 golang/go#20400). To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/lib/libedit/sig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libedit/sig.c diff -u src/lib/libedit/sig.c:1.27 src/lib/libedit/sig.c:1.28 --- src/lib/libedit/sig.c:1.27 Fri Feb 3 14:47:38 2023 +++ src/lib/libedit/sig.c Wed Dec 18 10:38:52 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: sig.c,v 1.27 2023/02/03 19:47:38 christos Exp $ */ +/* $NetBSD: sig.c,v 1.28 2024/12/18 15:38:52 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: sig.c,v 1.27 2023/02/03 19:47:38 christos Exp $"); +__RCSID("$NetBSD: sig.c,v 1.28 2024/12/18 15:38:52 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -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;