From: Daniel Stenberg Date: Sun, 4 Aug 2024 22:17:17 +0000 (+0200) Subject: sigpipe: init the struct so that first apply ignores X-Git-Tag: curl-8_10_0~390 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eec5afbd0b6377eca893c392569b2faf094d970;p=thirdparty%2Fcurl.git sigpipe: init the struct so that first apply ignores 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 --- diff --git a/lib/sigpipe.h b/lib/sigpipe.h index b91a2f5133..d78afd905d 100644 --- a/lib/sigpipe.h +++ b/lib/sigpipe.h @@ -39,6 +39,7 @@ struct sigpipe_ignore { static void sigpipe_init(struct sigpipe_ignore *ig) { memset(ig, 0, sizeof(*ig)); + ig->no_signal = TRUE; } /*