Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Spawner patch

This patch just increase command line buffer up to OS limit (2K). It also
replaces java/lang/Exception to java/io/IOException in order to unify error
processing.

Index: Win32ProcessEx.c
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c,v
retrieving revision 1.11
diff -u -r1.11 Win32ProcessEx.c
--- Win32ProcessEx.c 24 Apr 2003 21:16:14 -0000 1.11
+++ Win32ProcessEx.c 28 Aug 2003 19:57:40 -0000
@@ -25,7 +25,7 @@
 // #define DEBUG_MONITOR

 #define PIPE_SIZE 512
-#define MAX_CMD_SIZE 1024
+#define MAX_CMD_SIZE 2049
 #define MAX_ENV_SIZE 4096

 #define MAX_PROCS (100)
@@ -102,7 +102,7 @@

  if((HIBYTE(LOWORD(GetVersion()))) & 0x80)
   {
-  ThrowByName(env, "java/lang/IOException", "Does not support Windows
3.1/95/98/Me");
+  ThrowByName(env, "java/io/IOException", "Does not support Windows
3.1/95/98/Me");
   return 0;
   }

@@ -166,7 +166,7 @@
    {
    if(0 > (nCpyLen = copyTo(szCmdLine + nPos, str, len, MAX_CMD_SIZE -
nPos)))
     {
-    ThrowByName(env, "java/lang/Exception", "Too long command line");
+    ThrowByName(env, "java/io/IOException", "Too long command line");
     return 0;
     }
    nPos += nCpyLen;
@@ -195,7 +195,7 @@
      szEnvBlock = (char *)realloc(szEnvBlock, nBlkSize);
      if(NULL == szEnvBlock)
       {
-      ThrowByName(env, "java/lang/Exception", "Not enough memory");
+      ThrowByName(env, "java/io/IOException", "Not enough memory");
       return 0;
       }
 #ifdef DEBUG_MONITOR
@@ -388,7 +388,7 @@
    {
    if(0 > (nCpyLen = copyTo(szCmdLine + nPos, str, len, MAX_CMD_SIZE -
nPos)))
     {
-    ThrowByName(env, "java/lang/Exception", "Too long command line");
+    ThrowByName(env, "java/io/IOException", "Too long command line");
     return 0;
     }
    nPos += nCpyLen;
@@ -417,7 +417,7 @@
      szEnvBlock = (char *)realloc(szEnvBlock, nBlkSize);
      if(NULL == szEnvBlock)
       {
-      ThrowByName(env, "java/lang/Exception", "Not enough memory");
+      ThrowByName(env, "java/io/IOException", "Not enough memory");
       return 0;
       }
      }

Index: starter.cpp
===================================================================
RCS file:
/home/tools/org.eclipse.cdt.core.win32/library/starter/starter.cpp,v
retrieving revision 1.5
diff -u -r1.5 starter.cpp
--- starter.cpp 25 Feb 2003 16:05:39 -0000 1.5
+++ starter.cpp 28 Aug 2003 19:59:24 -0000
@@ -24,7 +24,7 @@
 #include <stdio.h>

 // #define DEBUG_MONITOR
-#define MAX_CMD_LINE_LENGTH (1024)
+#define MAX_CMD_LINE_LENGTH (2049)

 int copyTo(char * target, const char * source, int cpyLength, int
availSpace);





Back to the top