summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-03-23 15:56:43 +0100
committerVolker Lendecke <vl@samba.org>2012-03-23 17:31:24 +0100
commit9e17e7d7f28bc186d316f8b8c89e0c6d266a2196 (patch)
tree1de1d06be83e5bc4eaccdf589cae1bc9c9f213d0
parent1cc7abf8aada94be6f35f1f81edd248801d8fe5a (diff)
downloadsamba-9e17e7d7f28bc186d316f8b8c89e0c6d266a2196.tar.gz
samba-9e17e7d7f28bc186d316f8b8c89e0c6d266a2196.tar.bz2
samba-9e17e7d7f28bc186d316f8b8c89e0c6d266a2196.zip
lib/async_req: Retry read_packet with read(2)
This way it will also work with pipes Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri Mar 23 17:31:24 CET 2012 on sn-devel-104
-rw-r--r--lib/async_req/async_sock.c4
1 files changed, 4 insertions, 0 deletions
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;