[PATCH] lib: Remove use of MSG_NOSIGNAL

vl at samba.org vl at samba.org
Mon May 29 19:39:07 UTC 2017


Hi!

Review appreciated!

Thanks, Volker
-------------- next part --------------
From 560dadf70847ea9e438fbf2be73ab93cbd6018a2 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 29 May 2017 16:15:50 +0200
Subject: [PATCH] lib: Remove use of MSG_NOSIGNAL

According to susv4 sendmsg, NOSIGAL is effective for stream-oriented sockets.
Datagram sockets won't send SIGPIPE anyway. Looking at Linux kernel sources,
this is only looked at in stream functions. I guess this is a left-over from my
tmsgd attempts, which was based on stream sockets. messaging_dgm still only
uses datagram sockets, so MSG_NOSIGNAL is not needed here.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12502
Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/lib/messages_dgm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index dff8357..095a319 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -363,7 +363,7 @@ static ssize_t messaging_dgm_sendmsg(int sock,
 		msghdr_prep_fds(&msg, buf, fdlen, fds, num_fds);
 
 		do {
-			ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+			ret = sendmsg(sock, &msg, 0);
 		} while ((ret == -1) && (errno == EINTR));
 	}
 
-- 
2.1.4



More information about the samba-technical mailing list