>From edecf4ac3c824f9312865dbbeb561630c5360309 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 5 Apr 2021 10:13:49 -0700 Subject: [PATCH] =?UTF-8?q?[int]=20Don=E2=80=99t=20use=20SIGSTKSZ=20in=20#?= =?UTF-8?q?if?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Christoph Karl in: https://lists.gnu.org/r/bug-rcs/2021-04/msg00000.html * b-isr.c (ISR_STACK_SIZE): Remove. (isr_init): Don’t assume SIGSTKSZ is a preprocessor constant. --- src/ChangeLog | 8 ++++++++ src/b-isr.c | 13 ++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3e21bda..5463be3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2021-04-05 Paul Eggert + + [int] Don’t use SIGSTKSZ in #if + Problem reported by Christoph Karl in: + https://lists.gnu.org/r/bug-rcs/2021-04/msg00000.html + * b-isr.c (ISR_STACK_SIZE): Remove. + (isr_init): Don’t assume SIGSTKSZ is a preprocessor constant. + 2020-10-24 Thien-Thi Nguyen [int] Use ‘NULL’ instead of '\0'. diff --git a/src/b-isr.c b/src/b-isr.c index f03794c..fc86cea 100644 --- a/src/b-isr.c +++ b/src/b-isr.c @@ -198,22 +198,17 @@ setup_catchsig (size_t count, int const set[VLA_ELEMS (count)]) #undef MUST } -#if defined HAVE_SIGALTSTACK && defined SIGSTKSZ -#define ISR_STACK_SIZE (10 * SIGSTKSZ) -#else -#define ISR_STACK_SIZE 0 -#endif - struct isr_scratch * isr_init (bool *be_quiet) { struct isr_scratch *scratch = ZLLOC (1, struct isr_scratch); -#if ISR_STACK_SIZE +#if defined HAVE_SIGALTSTACK && defined SIGSTKSZ + size_t stack_size = 10 * SIGSTKSZ; stack_t ss = { - .ss_sp = alloc (PLEXUS, ISR_STACK_SIZE), - .ss_size = ISR_STACK_SIZE, + .ss_sp = alloc (PLEXUS, stack_size), + .ss_size = stack_size, .ss_flags = 0 }; -- 2.30.2