[netperf-dev] netperf2 commit notice r533 - in trunk: . src

raj at netperf.org raj at netperf.org
Thu Feb 2 10:22:48 PST 2012


Author: raj
Date: 2012-02-02 10:22:48 -0800 (Thu, 02 Feb 2012)
New Revision: 533

Modified:
   trunk/Release_Notes
   trunk/src/netserver.c
Log:
fix a problem pointed out by Waqar Sheikh

Modified: trunk/Release_Notes
===================================================================
--- trunk/Release_Notes	2012-02-01 22:43:37 UTC (rev 532)
+++ trunk/Release_Notes	2012-02-02 18:22:48 UTC (rev 533)
@@ -1,5 +1,8 @@
 These are the Release Notes for post Revision 2.5.0 top-of-trunk netperf:
 
+*) Fix a problem with late checking of the return from select() in
+   src/netserver.c. Reported by Waqar Sheikh.
+
 *) A new global -Z option has been added to netperf and netserver.
    This takes as an argument a passphrase.  In the case of netserver
    it will expect a control message with the passphrase as the first

Modified: trunk/src/netserver.c
===================================================================
--- trunk/src/netserver.c	2012-02-01 22:43:37 UTC (rev 532)
+++ trunk/src/netserver.c	2012-02-02 18:22:48 UTC (rev 533)
@@ -1266,6 +1266,16 @@
 		       &except_fds,
 		       NULL);
 
+    if (num_ready < 0) {
+      fprintf(where,
+	      "%s: select failure: %s (errno %d)\n",
+	      __FUNCTION__,
+	      strerror(errno),
+	      errno);
+      fflush(where);
+      exit(1);
+    }
+
     /* try to keep things simple */
     candidate = 0;
     while ((num_ready) && (candidate <= high_fd)) {
@@ -1278,16 +1288,6 @@
 	candidate++;
       }
     }
-
-    if (num_ready < 0) {
-      fprintf(where,
-	      "%s: select failure: %s (errno %d)\n",
-	      __FUNCTION__,
-	      strerror(errno),
-	      errno);
-      fflush(where);
-      exit(1);
-    }
   }
 }
 



More information about the netperf-dev mailing list