On 2026-04-01 14:46, Paul Eggert wrote:
On 2026-04-01 13:52, Bruno Haible wrote:
A better way is to introduce a flag GNULIB_SIGACTION_SINGLE_THREAD,
that can be defined in configure.ac.

Thanks, that (and your other recent changes) all work for me, for gzip.

Whoops, I spoke too soon. First, the identifier is spelled GNULIB_SIGPROCMASK_SINGLE_THREAD not GNULIB_SIGACTION_SINGLE_THREAD. I plan to change gzip etc. accordingly.

Second, the then- and else-parts of that #if were mistakenly swapped. I installed the attached to fix that.

From 7497397ad451cc676015dc60b6dd35e0180a24be Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Fri, 3 Apr 2026 11:22:54 -0700
Subject: [PATCH] sigprocmask: single-thread optimization typo fix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lib/sigprocmask.c (gl_lock_define_initialized):
Swap #if’s then- and else-parts.
---
 ChangeLog         | 6 ++++++
 lib/sigprocmask.c | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1702fb2636..48ac41eee4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-04-03  Paul Eggert  <[email protected]>
+
+	sigprocmask: single-thread optimization typo fix
+	* lib/sigprocmask.c (gl_lock_define_initialized):
+	Swap #if’s then- and else-parts.
+
 2026-04-02  Bruno Haible  <[email protected]>
 
 	mbrtoc32: Optimize single-locale case on glibc systems.
diff --git a/lib/sigprocmask.c b/lib/sigprocmask.c
index 9ee0355ce0..7866dbed59 100644
--- a/lib/sigprocmask.c
+++ b/lib/sigprocmask.c
@@ -25,11 +25,11 @@
 #include <stdlib.h>
 
 #if GNULIB_SIGPROCMASK_SINGLE_THREAD
-# include "glthread/lock.h"
-#else
 # define gl_lock_define_initialized(storageclass,name)
 # define gl_lock_lock(lock)
 # define gl_lock_unlock(lock)
+#else
+# include "glthread/lock.h"
 #endif
 
 #if HAVE_MSVC_INVALID_PARAMETER_HANDLER
-- 
2.51.0

Reply via email to