Use MSG_NOSIGNAL when calling send() to avoid SIGPIPE

libnfs-4.0.0-vitalif
Shreyas Siravara 2018-04-23 12:29:59 -07:00
parent 8b064bf971
commit e8a200483f
1 changed files with 1 additions and 1 deletions

View File

@ -221,7 +221,7 @@ rpc_write_to_socket(struct rpc_context *rpc)
total = pdu->outdata.size;
count = send(rpc->fd, pdu->outdata.data + pdu->written,
(int)(total - pdu->written), 0);
(int)(total - pdu->written), MSG_NOSIGNAL);
if (count == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
return 0;