harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r486151 - /harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c
Date Tue, 12 Dec 2006 14:01:14 GMT
Author: geirm
Date: Tue Dec 12 06:01:14 2006
New Revision: 486151

URL: http://svn.apache.org/viewvc?view=rev&rev=486151
Log:
for whatever reason, it didn't work to have a 
exe and then the params as the second arg to 
CreateProcess.  So just do one and figure it
out later.


Modified:
    harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c

Modified: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c?view=diff&rev=486151&r1=486150&r2=486151
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c (original)
+++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c Tue Dec 12
06:01:14 2006
@@ -163,7 +163,7 @@
             strcat(classpath, LIB_POSTFIX);
             strcat(classpath, pToolData->jarList[i]);
         }
-                         
+ 
         myArgv[newIndex++] = "-cp";
         myArgv[newIndex++] = classpath;
 
@@ -207,13 +207,15 @@
         }
     }
     
-    toolName = (char *) malloc(sizeof(char) * j);
+    toolName = (char *) malloc(sizeof(char) * j + strlen(fullExePath) + 1 + 1);
     
     if (toolName == NULL) { 
         return 4;
     }
     
-    strcpy(toolName,myArgv[1]);
+    strcpy(toolName, fullExePath);
+    strcat(toolName, " ");
+    strcat(toolName,myArgv[1]);
     strcat(toolName, " ");
         
     for (i=2; i < myArgvCount; i++) {
@@ -225,12 +227,12 @@
             break;
         }
     }
-   
+    
     memset(&procInfo, 0, sizeof(PROCESS_INFORMATION));
     memset(&startInfo, 0, sizeof(STARTUPINFO));
     startInfo.cb = sizeof(STARTUPINFO);
             
-    CreateProcess(fullExePath, toolName, NULL, NULL,
+    CreateProcess(NULL, toolName, NULL, NULL,
                     FALSE, 0, NULL, NULL, &startInfo, &procInfo);    
 #else    
     execv(fullExePath, myArgv);
@@ -398,12 +400,7 @@
         while (EOF != (count= fscanf(fp, "%s = %s\n", key, value))) {
             // printf("count = %d : %s = %s\n", count, key, value);
 
-#if defined(LINUX)            
-            if (count == 2 && !strcasecmp("tooljar", key)) {
-#endif
-#if defined(WIN32)
-            if (count == 2 && !strcmp("tooljar", key)) {
-#endif
+            if (count == 2 && !strcmp("ToolJar", key)) {
                 pToolData->jarList = (char **) realloc(pToolData->jarList, (pToolData->numJars
+ 1) * sizeof(char *));
                 pToolData->jarList[pToolData->numJars++] = strdup(value);
             }



Mime
View raw message