diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-10-30 16:07:06 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-10-30 16:07:06 +0000 |
| commit | 4607763e7972a1ce96d9082f4cee86d6dae5d90b (patch) | |
| tree | b342950842c7bf10135fd62320e383e1c4579497 | |
| parent | client: 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.
| -rw-r--r-- | client.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |
