/* Blocking call */
new_fd = accept(sock, (struct sockaddr *) &sun, &len);
if (new_fd < 0) {
- PERROR("accept");
- return -errno;
+ if (errno != ECONNABORTED)
+ PERROR("accept");
+ new_fd = -errno;
+ if (new_fd == -ECONNABORTED)
+ new_fd = -EPIPE;
}
return new_fd;
}
if (errno != EPIPE && errno != ECONNRESET)
PERROR("recvmsg");
ret = -errno;
+ if (ret == -ECONNRESET)
+ ret = -EPIPE;
shutret = shutdown(sock, SHUT_RDWR);
if (shutret)
if (errno != EPIPE && errno != ECONNRESET)
PERROR("sendmsg");
ret = -errno;
+ if (ret == -ECONNRESET)
+ ret = -EPIPE;
shutret = shutdown(sock, SHUT_RDWR);
if (shutret)
if (errno != EPIPE && errno != ECONNRESET) {
PERROR("sendmsg");
}
+ ret = -errno;
+ if (ret == -ECONNRESET)
+ ret = -EPIPE;
}
return ret;
}
}
if (errno == EPIPE || errno == ECONNRESET)
ret = -errno;
+ if (ret == -ECONNRESET)
+ ret = -EPIPE;
goto end;
}
if (ret == 0) {