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

raj at netperf.org raj at netperf.org
Fri Apr 4 12:20:34 PDT 2008


Author: raj
Date: 2008-04-04 12:20:33 -0700 (Fri, 04 Apr 2008)
New Revision: 275

Modified:
   trunk/AUTHORS
   trunk/Release_Notes
   trunk/src/netserver.c
Log:
long path to netserver fix

Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS	2008-03-21 17:52:44 UTC (rev 274)
+++ trunk/AUTHORS	2008-04-04 19:20:33 UTC (rev 275)
@@ -220,4 +220,8 @@
 Fix to use vfork() instead of fork() on platforms without fork()
 
 Simon Burge <simonb at NetBSD.org>
-Fixes for *BSD CPU util.
\ No newline at end of file
+Fixes for *BSD CPU util.
+
+Adam Bidema
+Fixes for launching netserver children when the path to netserver.exe
+is very long. 
\ No newline at end of file

Modified: trunk/Release_Notes
===================================================================
--- trunk/Release_Notes	2008-03-21 17:52:44 UTC (rev 274)
+++ trunk/Release_Notes	2008-04-04 19:20:33 UTC (rev 275)
@@ -2,6 +2,9 @@
 
 Things changed in this release:
 
+*) Fixes from Adam Bidema for launching netserver children when the
+   path to netserver.exe is very long.  
+
 *) For the first time, netperf2 has a dependency, albeit optional, on
    another non-base-os bit of code - libsmbios under Linux.  It will
    attept to detect this at compile time and use it to report the

Modified: trunk/src/netserver.c
===================================================================
--- trunk/src/netserver.c	2008-03-21 17:52:44 UTC (rev 274)
+++ trunk/src/netserver.c	2008-04-04 19:20:33 UTC (rev 275)
@@ -712,11 +712,14 @@
 #elif WIN32
 		{
 			BOOL b;
-			char cmdline[80];
+			char *cmdline;
 			PROCESS_INFORMATION pi;
 			STARTUPINFO si;
 			int i;
 
+			/* create the cmdline array based on strlen(program) + 80 chars */
+			cmdline = malloc(strlen(program) + 80);
+
 			memset(&si, 0 , sizeof(STARTUPINFO));
 			si.cb = sizeof(STARTUPINFO);
 
@@ -752,6 +755,7 @@
 			if (!b)
 			{
 				perror("CreateProcessfailure: ");
+				free(cmdline); /* even though we exit :) */
 				exit(1);
 			}
 
@@ -764,6 +768,7 @@
 			/* And close the server_sock since the child will own it. */
 
 			close(server_sock);
+			free(cmdline);
 		}
 #else
       signal(SIGCLD, SIG_IGN);



More information about the netperf-dev mailing list