[mpich-commits] r10761 - mpich2/trunk/test/mpi/manual

gropp at mcs.anl.gov gropp at mcs.anl.gov
Tue Dec 11 11:02:15 CST 2012


Author: gropp
Date: 2012-12-11 11:02:15 -0600 (Tue, 11 Dec 2012)
New Revision: 10761

Modified:
   mpich2/trunk/test/mpi/manual/singjoin.c
Log:
Added more error checking

Modified: mpich2/trunk/test/mpi/manual/singjoin.c
===================================================================
--- mpich2/trunk/test/mpi/manual/singjoin.c	2012-12-11 17:01:38 UTC (rev 10760)
+++ mpich2/trunk/test/mpi/manual/singjoin.c	2012-12-11 17:02:15 UTC (rev 10761)
@@ -81,11 +81,19 @@
 		return -1;
 	}
 
-	listen(listenfd, 1024);
+	ret = listen(listenfd, 1024);
+        if (ret < 0) {
+            perror( "server listen" );
+            return -1;
+        }
 
 	peer_addr_size = sizeof(peer_addr);
 	peer_fd = accept(listenfd, (struct sockaddr *)&peer_addr, &peer_addr_size);
 
+        if (peer_fd < 0) {
+            perror( "server accept" );
+            return -1;
+        }
 	return peer_fd;
 }
 



More information about the commits mailing list