From ae60f325647f628d69ea2fad1f923bad9aae281b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Posp=C3=AD=C5=A1il?= Date: Mon, 9 May 2005 12:57:25 +0000 Subject: [PATCH] Remove incorrect looping in edg_wll_socket_write(). --- org.glite.lb.common/src/log_msg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/org.glite.lb.common/src/log_msg.c b/org.glite.lb.common/src/log_msg.c index d495cbf..d6adc91 100644 --- a/org.glite.lb.common/src/log_msg.c +++ b/org.glite.lb.common/src/log_msg.c @@ -41,11 +41,14 @@ edg_wll_socket_write( gettimeofday(&before, NULL); } len = write(sock, buf, bufsize); - while ( len <= 0 ) { + if ( len <= 0 && errno == EAGAIN ) { FD_ZERO(&fds); FD_SET(sock,&fds); - if ( select(sock+1, &fds,NULL,NULL, timeout? &to: NULL) < 0 ) return -1; - len = write(sock, buf, bufsize); + if ( select(sock+1, NULL, &fds, NULL, timeout? &to: NULL) < 0 ) { + len = -1; + } else { + len = write(sock, buf, bufsize); + } } if ( timeout ) { gettimeofday(&after, NULL); -- 1.8.2.3