Commit d4278ce0 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

rpcrt4: Take care of EINTR on send/recv.

parent 49ef87c3
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -1464,6 +1465,8 @@ static int rpcrt4_conn_tcp_read(RpcConnection *Connection, ...@@ -1464,6 +1465,8 @@ static int rpcrt4_conn_tcp_read(RpcConnection *Connection,
return -1; return -1;
else if (r > 0) else if (r > 0)
bytes_read += r; bytes_read += r;
else if (errno == EINTR)
continue;
else if (errno != EAGAIN) else if (errno != EAGAIN)
{ {
WARN("recv() failed: %s\n", strerror(errno)); WARN("recv() failed: %s\n", strerror(errno));
...@@ -1489,6 +1492,8 @@ static int rpcrt4_conn_tcp_write(RpcConnection *Connection, ...@@ -1489,6 +1492,8 @@ static int rpcrt4_conn_tcp_write(RpcConnection *Connection,
int r = send(tcpc->sock, (const char *)buffer + bytes_written, count - bytes_written, 0); int r = send(tcpc->sock, (const char *)buffer + bytes_written, count - bytes_written, 0);
if (r >= 0) if (r >= 0)
bytes_written += r; bytes_written += r;
else if (errno == EINTR)
continue;
else if (errno != EAGAIN) else if (errno != EAGAIN)
return -1; return -1;
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment