From c181037c4d53576069d8e9ee7ad74213fb6d4974 Mon Sep 17 00:00:00 2001 From: pkova Date: Fri, 22 Nov 2024 17:41:32 +0200 Subject: [PATCH] main: really ignore SIGPIPE --- pkg/vere/king.c | 8 ++++---- pkg/vere/main.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/vere/king.c b/pkg/vere/king.c index 4f2009bb09..dc27f0cd45 100644 --- a/pkg/vere/king.c +++ b/pkg/vere/king.c @@ -964,10 +964,10 @@ u3_king_commence() // Ignore SIGPIPE signals. { - struct sigaction sig_s = {{0}}; - sigemptyset(&(sig_s.sa_mask)); - sig_s.sa_handler = SIG_IGN; - sigaction(SIGPIPE, &sig_s, 0); + sigset_t set_s; + sigemptyset(&set_s); + sigaddset(&set_s, SIGPIPE); + pthread_sigmask(SIG_BLOCK, &set_s, NULL); } // boot the ivory pill diff --git a/pkg/vere/main.c b/pkg/vere/main.c index cc6c83e7fd..3083aae5bf 100644 --- a/pkg/vere/main.c +++ b/pkg/vere/main.c @@ -1151,10 +1151,10 @@ _cw_init_io(uv_loop_t* lup_u) // Ignore SIGPIPE signals. // { - struct sigaction sig_s = {{0}}; - sigemptyset(&(sig_s.sa_mask)); - sig_s.sa_handler = SIG_IGN; - sigaction(SIGPIPE, &sig_s, 0); + sigset_t set_s; + sigemptyset(&set_s); + sigaddset(&set_s, SIGPIPE); + pthread_sigmask(SIG_BLOCK, &set_s, NULL); } // configure pipe to daemon process