From 65b72b4aaa2a6a09ec8d91e20aa469af69497676 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 6 Aug 2016 03:09:35 +0200 Subject: If send fails with EPIPE, set errno to ECONNRESET instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/util.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libmdsserver') diff --git a/src/libmdsserver/util.c b/src/libmdsserver/util.c index a3e18a9..a598fb0 100644 --- a/src/libmdsserver/util.c +++ b/src/libmdsserver/util.c @@ -196,6 +196,8 @@ size_t send_message(int socket, const char* message, size_t length) while (length > 0) if ((just_sent = send(socket, message + sent, min(block_size, length), MSG_NOSIGNAL)) < 0) { + if (errno == EPIPE) + errno = ECONNRESET; if (errno == EMSGSIZE) { block_size >>= 1; -- cgit v1.2.3-70-g09d2