From 4607763e7972a1ce96d9082f4cee86d6dae5d90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 30 Oct 2021 18:07:06 +0200 Subject: [PATCH] client: use MSG_NOSIGNAL in send(3) MSG_NOSIGNAL Requests not to send the SIGPIPE signal if an attempt to send is made on a stream-oriented socket that is no longer connected. The [EPIPE] error shall still be returned. --- client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.c b/client.c index 591aca49..5d3bd58c 100644 --- a/client.c +++ b/client.c @@ -46,7 +46,7 @@ sendall(int sock, const void *_buf, size_t len) size_t left = len; while (left > 0) { - ssize_t r = send(sock, buf, left, 0); + ssize_t r = send(sock, buf, left, MSG_NOSIGNAL); if (r < 0) { if (errno == EINTR) continue;