From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=altlinux.org; s=dkim; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZVISzu/Zd4WVfTe6g3w4axl7lYsZ9jJ55seSfp/0g4I=; b=kwRuoRrlBdW11pxopKQ7ml3Tl6 vXCnnwh/BGWuf1ra+D1/bTinzrNnNlVIqBtpLLmADPIo7Auh1bbCroP5/FXJT9lITmDcfxiKVMuy4 cPl0LKYv1A2gdHQqiwfvqq1DMDqNU5LSkZmyZtUzf5jZYlfiTXUdCV/A0DoS3KZxMf4hhg5WTET0N f8lCvWJpMJqHyYdX7e77ClhbUb03Uw2WtwENVIE9HfoxaJqljX9l7ogQtx6PdRJc65i7VVrx7hDB2 D8gB1D75swojs3fn+MOvY+LeEnvZUemCLM1V8gb92SXAk+YSvmY6bqYrQcS5Mi2xEnVAd4GPVaZ2K xh4VNVGw==; From: Arseny Maslennikov To: devel@lists.altlinux.org Date: Tue, 24 Aug 2021 11:24:31 +0300 Message-Id: <20210824082436.1555890-3-arseny@altlinux.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210824082436.1555890-1-arseny@altlinux.org> References: <20210824082436.1555890-1-arseny@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 10.15.13.28 X-SA-Exim-Mail-From: arseny@altlinux.org X-SA-Exim-Version: 4.2.1 X-SA-Exim-Scanned: No (on mail.cs.msu.ru); Unknown failure Cc: Arseny Maslennikov Subject: [devel] [PATCH hasher-priv v3 2/7] sockets: xsendmsg: get rid of SIGPIPE on socket writes X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2021 08:25:05 -0000 Archived-At: List-Archive: List-Post: In the daemon, we do not want to receive SIGPIPE and very much prefer to handle emerging communication errors ourselves. In the client, SIGPIPE is a bit more bearable. It prevents logging to stderr, though, so we'd like to avoid that as well. Signed-off-by: Arseny Maslennikov --- hasher-priv/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hasher-priv/sockets.c b/hasher-priv/sockets.c index baad57e..3451627 100644 --- a/hasher-priv/sockets.c +++ b/hasher-priv/sockets.c @@ -137,7 +137,7 @@ xsendmsg(int conn, void *data, size_t len) msg.msg_iov = &iov; msg.msg_iovlen = 1; - ssize_t n = sendmsg_retry(conn, &msg, 0); + ssize_t n = sendmsg_retry(conn, &msg, MSG_NOSIGNAL); if (n != (ssize_t) len) { if (n < 0) -- 2.32.0