mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
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.
This commit is contained in:
parent
cad48c1b0a
commit
4607763e79
1 changed files with 1 additions and 1 deletions
2
client.c
2
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue