Thread (14 messages) 14 messages, 2 authors, 2018-04-18

Re: [PATCH 1/3] vhost: do not generate signal when sendmsg fails

From: Maxime Coquelin <hidden>
Date: 2018-03-29 13:46:07


On 03/06/2018 11:43 AM, Tiwei Bie wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Tiwei Bie <redacted>
---
  lib/librte_vhost/socket.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index 0354740fa..d703d2114 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -181,7 +181,7 @@ send_fd_message(int sockfd, char *buf, int buflen, int *fds, int fd_num)
  	}
  
  	do {
-		ret = sendmsg(sockfd, &msgh, 0);
+		ret = sendmsg(sockfd, &msgh, MSG_NOSIGNAL);
  	} while (ret < 0 && errno == EINTR);
  
  	if (ret < 0) {
Applied to dpdk-next-virtio/master with below commit message

------------------------------------------------------------
More precisely, do not generate a SIGPIPE signal if the peer
has closed the connection. Otherwise, it will terminate the
process by default. As a library, we should avoid terminating
the application process when error happens and just need to
return with an error.
------------------------------------------------------------

Thanks,
Maxime
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help