From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS51083 80.67.180.0/24 X-Spam-Status: No, score=-3.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from mermet.sourcephile.fr (revolt129.abo.ilico.org [80.67.180.129]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 175281F670 for ; Fri, 11 Mar 2022 10:46:39 +0000 (UTC) From: Julien Moutinho DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourcephile.fr; s=20200101; t=1646995594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fvTU8KneZGJXcYu279UvM4BiGxoLNP2AwxlzbnDu9Bg=; b=RR8hy7Ht5stis+S7C0dK55ByFtnBufHK7tfBg2IXDBp0YfkukJoG0vIPxPecZFEx/da4ju apa9YcH/kWqln7c8ExHrTgHZlsPAJhsnw3b4A/XZXZiQ1FdcP6KstqpJLEhvbeUJaKGUzW CLRGNZzOBLT8KWOFGGW+TxpxSfpSQPWr6p7YUXpfZF4YWtWrMZ3fqqMZrJVj5f3WwzYuG7 uOiIJGqkjVtXIEt2VwwbXykHUgCxhkZ0HeODRcvXQJgGL6OsNS+3PxMoqT68gkpfCv2c4i zJ78eJfS4gbV7nrhxMH0t7TfG7HYFv7wMLdEg6A92TkGxG8RvgtNP9zWwJlb6vkltHCMtD HjunKMwFz3FfrTRSxeVyaQEDQcX5zvdGXKMAq7PsE36Xr1RaMiuf7pG+IroChlv+GIKL1R YhsZxcm9jRrfPgaAx7GxxKsVm+CDC+Db8E+dj7l1agRrdHm8c9rxmqHlBM21v2J2IVzZX/ PbFl46AvKAAgYCbA4CS06oMtxbObpyWgHckAyivnwexP1+JeyPTQxgrp2Ieip8R2UM0M3B Wv7nF945WtzCYGP5fNeIvtgXPD2FEcsOwkaFEgQFEtEnjvcSCCsUCxY2YquvhA6ndzLP12 II+612gWXuOl581aXkAHclVBTfgQFjp39vc2Nypyw9YDxE7oU04H8= To: meta@public-inbox.org Cc: Dominique Martinet , Eric Wong , Julien Moutinho Subject: [PATCH] t/lei-sigpipe.t: ensure SIGPIPE is not ignored instead of not blocked Date: Fri, 11 Mar 2022 11:42:34 +0100 Message-Id: <20220311104233.2408081-1-julm+public-inbox@sourcephile.fr> In-Reply-To: <20220227111714.GA13350@dcvr> References: <20220227111714.GA13350@dcvr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Ignoring a signal is different than blocking a signal. --- t/lei-sigpipe.t | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/t/lei-sigpipe.t b/t/lei-sigpipe.t index 7fab9aeb..55c208e2 100644 --- a/t/lei-sigpipe.t +++ b/t/lei-sigpipe.t @@ -4,20 +4,16 @@ use strict; use v5.10.1; use PublicInbox::TestCommon; -use POSIX qw(WTERMSIG WIFSIGNALED SIGPIPE SIG_UNBLOCK SIG_SETMASK sigprocmask); +use POSIX qw(WTERMSIG WIFSIGNALED SIGPIPE); use PublicInbox::OnDestroy; -# undo systemd (and similar) blocking SIGPIPE, since lei expects to be run +# undo systemd (and similar) ignoring SIGPIPE, since lei expects to be run # from an interactive terminal: # https://public-inbox.org/meta/20220227080422.gyqowrxomzu6gyin@sourcephile.fr/ -my $set = POSIX::SigSet->new; -my $old = POSIX::SigSet->new; -$set->emptyset or xbail "sigemptyset $!"; -$old->emptyset or xbail "sigemptyset $!"; -$set->addset(SIGPIPE); -sigprocmask(SIG_UNBLOCK, $set, $old) or xbail "SIG_UNBLOCK: $!"; +my $oldSIGPIPE = $SIG{PIPE}; +$SIG{PIPE} = 'DEFAULT'; my $cleanup = PublicInbox::OnDestroy->new($$, sub { - sigprocmask(SIG_SETMASK, $old); + $SIG{PIPE} = $oldSIGPIPE; }); test_lei(sub { -- 2.35.1