From 6fb3fcfc66ccff5e436285fca04041d82c310ea4 Mon Sep 17 00:00:00 2001 From: Ben Cohen Date: Fri, 8 Sep 2017 17:37:04 +0100 Subject: Handle EINTR for send() in handle_connection() --- xrdpapi/xrdp-ssh-agent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xrdpapi') diff --git a/xrdpapi/xrdp-ssh-agent.c b/xrdpapi/xrdp-ssh-agent.c index b62c4f99..0e80bb6b 100644 --- a/xrdpapi/xrdp-ssh-agent.c +++ b/xrdpapi/xrdp-ssh-agent.c @@ -287,6 +287,7 @@ handle_connection(int client_fd) if (rc == 1) { char *pos = buffer; + errno = 0; while (bytes_to_write > 0) { int bytes_written = send(client_fd, pos, bytes_to_write, 0); @@ -300,7 +301,7 @@ handle_connection(int client_fd) { fprintf(stderr, "send() returned 0!\n"); } - else + else if (errno != EINTR) { /* Error */ fprintf(stderr, "Error %d on recv\n", errno); -- cgit v1.2.1