Module: wine Branch: master Commit: 2bda19c6b00b60074e194437b9fa03b21d6e51da URL: http://source.winehq.org/git/wine.git/?a=commit;h=2bda19c6b00b60074e194437b9...
Author: Rob Shearman rob@codeweavers.com Date: Sun Dec 16 12:07:01 2007 +0000
rpcrt4: Return an error from rpcrt4_conn_tcp_read if recv returns 0.
---
dlls/rpcrt4/rpc_transport.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index e4d12c3..1a78a9d 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -967,10 +967,15 @@ static int rpcrt4_conn_tcp_read(RpcConnection *Connection, do { int r = recv(tcpc->sock, (char *)buffer + bytes_read, count - bytes_read, 0); - if (r >= 0) + if (!r) + return -1; + else if (r > 0) bytes_read += r; else if (errno != EAGAIN) + { + WARN("recv() failed: %s\n", strerror(errno)); return -1; + } else { struct pollfd pfds[2];