summaryrefslogtreecommitdiffstats
path: root/src/responder/common/responder_packet.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-03-17 12:52:54 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-03-17 12:03:58 -0400
commitcfff837d831b6f4e12dcc87c1d59789fe08597a6 (patch)
treed9a0b99adb7b7100dba6d564dd14be6e96f40dbe /src/responder/common/responder_packet.c
parent8834e6fe4f89d7b0227377619d96d455e1f28ebb (diff)
downloadsssd-cfff837d831b6f4e12dcc87c1d59789fe08597a6.tar.gz
sssd-cfff837d831b6f4e12dcc87c1d59789fe08597a6.tar.xz
sssd-cfff837d831b6f4e12dcc87c1d59789fe08597a6.zip
Fixes for client communication
- catch all errors of send() and recv(), not only EAGAIN - check if send() or recv() return EWOULDBLOCK or EINTR - remove unused parameter from client_send() and client_recv() - fix a debugging message
Diffstat (limited to 'src/responder/common/responder_packet.c')
-rw-r--r--src/responder/common/responder_packet.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/responder/common/responder_packet.c b/src/responder/common/responder_packet.c
index 6e581a3c9..d308ecd43 100644
--- a/src/responder/common/responder_packet.c
+++ b/src/responder/common/responder_packet.c
@@ -183,8 +183,12 @@ int sss_packet_recv(struct sss_packet *packet, int fd)
errno = 0;
rb = recv(fd, buf, len, 0);
- if (rb == -1 && errno == EAGAIN) {
- return EAGAIN;
+ if (rb == -1) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
+ return EAGAIN;
+ } else {
+ return errno;
+ }
}
if (rb == 0) {
@@ -219,8 +223,12 @@ int sss_packet_send(struct sss_packet *packet, int fd)
errno = 0;
rb = send(fd, buf, len, 0);
- if (rb == -1 && errno == EAGAIN) {
- return EAGAIN;
+ if (rb == -1) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
+ return EAGAIN;
+ } else {
+ return errno;
+ }
}
if (rb == 0) {