[devel] [PATCH hasher-priv v3 2/7] sockets: xsendmsg: get rid of SIGPIPE on socket writes

Arseny Maslennikov arseny на altlinux.org
Вт Авг 24 11:24:31 MSK 2021


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 <arseny на altlinux.org>
---
 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



Подробная информация о списке рассылки Devel