summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobbie Harwood <rharwood@redhat.com>2015-09-28 19:59:59 -0400
committerSimo Sorce <simo@redhat.com>2015-09-28 21:41:40 -0400
commitdf58bccfa5bfb42d7162f537c506a658729d4175 (patch)
treeab1ad3aa6ab4969b8ec455899a10630e2f413d82
parentca66399ac78ed97a901ba4fd1d8e55faf48567d1 (diff)
downloadgss-proxy-df58bccfa5bfb42d7162f537c506a658729d4175.tar.gz
gss-proxy-df58bccfa5bfb42d7162f537c506a658729d4175.tar.xz
gss-proxy-df58bccfa5bfb42d7162f537c506a658729d4175.zip
Correct handling of EINTR on read()/write()
The common send/recv functions where zeroing the ret variable only once causing a loop if EINTR as actually ever set. Signed-off-by: Robbie Harwood <rharwood@redhat.com> Signed-off-by: Simo Sorce <simo@redhat.com>
-rw-r--r--proxy/src/client/gpm_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/proxy/src/client/gpm_common.c b/proxy/src/client/gpm_common.c
index f0d5e11..6d626e8 100644
--- a/proxy/src/client/gpm_common.c
+++ b/proxy/src/client/gpm_common.c
@@ -160,8 +160,8 @@ static int gpm_send_buffer(struct gpm_ctx *gpmctx,
retry = false;
do {
- ret = 0;
do {
+ ret = 0;
wn = send(gpmctx->fd, &size, sizeof(uint32_t), MSG_NOSIGNAL);
if (wn == -1) {
ret = errno;
@@ -216,8 +216,8 @@ static int gpm_recv_buffer(struct gpm_ctx *gpmctx,
size_t pos;
int ret;
- ret = 0;
do {
+ ret = 0;
rn = read(gpmctx->fd, &size, sizeof(uint32_t));
if (rn == -1) {
ret = errno;