aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-10-30 16:07:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-10-30 16:07:06 +0000
commit4607763e7972a1ce96d9082f4cee86d6dae5d90b (patch)
treeb342950842c7bf10135fd62320e383e1c4579497 /client.c
parentclient: handle partial writes in send(3) (diff)
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.
Diffstat (limited to 'client.c')
-rw-r--r--client.c2
1 files changed, 1 insertions, 1 deletions
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;