[PATCH] sigpipe: init the struct so that first apply ignores
authorDaniel Stenberg <daniel@haxx.se>
Sun, 4 Aug 2024 22:17:17 +0000 (00:17 +0200)
committerCarlos Henrique Lima Melara <charlesmelara@riseup.net>
Fri, 9 Aug 2024 22:47:58 +0000 (19:47 -0300)
Initializes 'no_signal' to TRUE, so that a call to sigpipe_apply() after
init ignores the signal (unless CURLOPT_NOSIGNAL) is set.

I have read the existing code multiple times now and I think it gets the
initial state reversed this missing to ignore.

Regression from 17e6f06ea37136c36d27

Reported-by: Rasmus Thomsen
Fixes #14344
Closes #14390

Bug: https://github.com/curl/curl/issues/14344
Bug-Debian: https://bugs.debian.org/1077854
Origin: upstream, https://github.com/curl/curl/commit/3eec5afbd0b6377eca893c392569b2faf094d970
Last-Update: 2024-08-09

Gbp-Pq: Name ignore-SIGPIPE-after-init.patch

lib/sigpipe.h

index b91a2f513339567bcebb85a0f4b6d754b93d7dc9..d78afd905d34146f60a7fc78c0ca726fe8f24c55 100644 (file)
@@ -39,6 +39,7 @@ struct sigpipe_ignore {
 static void sigpipe_init(struct sigpipe_ignore *ig)
 {
   memset(ig, 0, sizeof(*ig));
+  ig->no_signal = TRUE;
 }
 
 /*