From 9e17e7d7f28bc186d316f8b8c89e0c6d266a2196 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 23 Mar 2012 15:56:43 +0100 Subject: lib/async_req: Retry read_packet with read(2) This way it will also work with pipes Autobuild-User: Volker Lendecke Autobuild-Date: Fri Mar 23 17:31:24 CET 2012 on sn-devel-104 --- lib/async_req/async_sock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c index 545d21378f..9909bc6eb3 100644 --- a/lib/async_req/async_sock.c +++ b/lib/async_req/async_sock.c @@ -596,6 +596,10 @@ static void read_packet_handler(struct tevent_context *ev, nread = recv(state->fd, state->buf+state->nread, total-state->nread, 0); + if ((nread == -1) && (errno == ENOTSOCK)) { + nread = read(state->fd, state->buf+state->nread, + total-state->nread); + } if ((nread == -1) && (errno == EINTR)) { /* retry */ return; -- cgit