};
while (hdr.msg_iovlen) {
- ssize_t res = sendmsg(fd, &hdr, 0);
+ ssize_t res = sendmsg(fd, &hdr, MSG_NOSIGNAL);
if (res < 0 && errno == EINTR)
continue;
void *ret = NULL;
int saved_errno;
unsigned int i, msg_len;
- struct sigaction ignorepipe, oldact;
/* Element 0 must be xsd_sockmsg */
assert(num_vecs >= 1);
msg->len = msg_len;
- ignorepipe.sa_handler = SIG_IGN;
- sigemptyset(&ignorepipe.sa_mask);
- ignorepipe.sa_flags = 0;
- sigaction(SIGPIPE, &ignorepipe, &oldact);
-
mutex_lock(&h->request_mutex);
if (!write_request(h, iovec, num_vecs))
mutex_unlock(&h->request_mutex);
- sigaction(SIGPIPE, &oldact, NULL);
if (reply_type == XS_ERROR) {
saved_errno = get_error(ret);
free(ret);
/* We're in a bad state, so close fd. */
saved_errno = errno;
mutex_unlock(&h->request_mutex);
- sigaction(SIGPIPE, &oldact, NULL);
close_fd:
close(h->fd);
h->fd = -1;