summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sss_client/ssh/sss_ssh_knownhostsproxy.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
index c6b0bd86..6424d7b7 100644
--- a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
+++ b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
@@ -135,27 +135,30 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len)
("read() failed (%d): %s\n", ret, strerror(ret)));
goto done;
} else if (res == 0) {
- break;
+ ret = EOK;
+ goto done;
}
+ errno = 0;
res = sss_atomic_write(i == 0 ? sock : 1, buffer, res);
+ ret = errno;
if (res == -1) {
- ret = errno;
DEBUG(SSSDBG_OP_FAILURE,
("sss_atomic_write() failed (%d): %s\n",
ret, strerror(ret)));
goto done;
+ } else if (ret == EPIPE) {
+ ret = EOK;
+ goto done;
}
}
if (fds[i].revents & POLLHUP) {
- break;
+ ret = EOK;
+ goto done;
}
}
}
- ret = EOK;
- DEBUG(SSSDBG_TRACE_FUNC, ("Connection closed\n"));
-
done:
if (sock >= 0) close(sock);