* by ignoring SIGPIPE, but we don't have this luxury on the
* libust side.
*/
- ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ do {
+ ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ } while (ret < 0 && errno == EINTR);
if (ret < 0 && errno != EPIPE) {
perror("sendmsg");
}
{
int ret;
- /* Shutdown receptions and transmissions */
- ret = shutdown(sock, SHUT_RDWR);
+ ret = close(sock);
if (ret < 0) {
- perror("shutdown");
+ perror("close");
}
return ret;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
- ret = sendmsg(sock, &msg, 0);
+ do {
+ ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ } while (ret < 0 && errno == EINTR);
if (ret < 0 && errno != EPIPE) {
perror("sendmsg");
}