[Pvfs2-cvs] commit by slang in pvfs2/src/io/bmi/bmi_tcp: sockio.c

CVS commit program cvs at parl.clemson.edu
Tue Dec 11 11:28:43 EST 2007


Update of /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp
In directory parlweb1:/tmp/cvs-serv6106/src/io/bmi/bmi_tcp

Modified Files:
	sockio.c 
Log Message:
fixes nonblocking recv call.


Index: sockio.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp/sockio.c,v
diff -p -u -r1.27 -r1.28
--- sockio.c	7 Dec 2007 23:05:11 -0000	1.27
+++ sockio.c	11 Dec 2007 16:28:43 -0000	1.28
@@ -27,6 +27,7 @@
 #include <assert.h>
 
 #include "sockio.h"
+#include "gossip.h"
 
 /* if the platform provides a MSG_NOSIGNAL option (which disables the
  * generation of signals on broken pipe), then use it
@@ -190,16 +191,12 @@ int BMI_sockio_nbrecv(int s,
     {
       nbrecv_restart:
 	ret = recv(s, buf, comp, DEFAULT_MSG_FLAGS);
-	if (!ret)	/* socket closed */
-	{
-	    errno = EPIPE;
-	    return (-1);
-	}
-	if (ret == -1 && errno == EWOULDBLOCK)
-	{
-	    return (len - comp);	/* return amount completed */
-	}
-	if (ret == -1 && (errno == EINTR || errno == EAGAIN))
+        if (ret == 0)
+        {
+            errno = EPIPE;
+            return (-1);
+        }
+	if (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK))
 	{
 	    goto nbrecv_restart;
 	}



More information about the Pvfs2-cvs mailing list