From cf54615b84f733449dc358bbcbf773fde3572527 Mon Sep 17 00:00:00 2001 From: Bartlomiej Grzelewski Date: Tue, 22 Dec 2015 16:59:05 +0100 Subject: [PATCH] common: block sig pipe during send call Change-Id: I05d44ac963cfa85878d83526d7143b5d6e8efe55 --- common/proto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/proto.c b/common/proto.c index 8891092..48d2b8b 100644 --- a/common/proto.c +++ b/common/proto.c @@ -355,7 +355,7 @@ int proto_send_block(int fd, enum message_type type, uint8_t *data, int32_t len) memcpy(hdr->data, &data[sent], hdr->len); - r = send(fd, hdr, sizeof(*hdr) + hdr->len, 0); + r = send(fd, hdr, sizeof(*hdr) + hdr->len, MSG_NOSIGNAL); if (r == -1) { bxt_err("send: fd %d errno %d", fd, errno); return -1; @@ -421,7 +421,7 @@ int proto_send(int fd, enum message_type type, uint8_t *data, int32_t len) } } while (r < 0); - r = send(fd, buf, sizeof(*hdr) + len, 0); + r = send(fd, buf, sizeof(*hdr) + len, MSG_NOSIGNAL); free(buf); -- 2.7.4