[cmake-commits] alex committed ProcessUNIX.c 1.67 1.67.22.1 System.c 1.6 1.6.26.1

cmake-commits at cmake.org cmake-commits at cmake.org
Thu May 17 10:24:39 EDT 2007


Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv18561/Source/kwsys

Modified Files:
      Tag: CMake-CrossCompileBasic
	ProcessUNIX.c System.c 
Log Message:

ENH: merge changes from HEAD into the branch
-change INCLUDE(file [OPTIONAL] [VAR]) to INCLUDE(file [OPTIONAL] [RESULT_VARIABLE VAR])
-add tests for INCLUDE(), CMAKE_TOOLCHAIN_FILE and FIND_XXX()
-keep the stripping in CPack for now
-support a MS toolchain suffix

Alex


Index: ProcessUNIX.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/ProcessUNIX.c,v
retrieving revision 1.67
retrieving revision 1.67.22.1
diff -u -d -r1.67 -r1.67.22.1
--- ProcessUNIX.c	5 Dec 2006 14:02:32 -0000	1.67
+++ ProcessUNIX.c	17 May 2007 14:24:37 -0000	1.67.22.1
@@ -2228,6 +2228,12 @@
 }
 
 /*--------------------------------------------------------------------------*/
+static void kwsysProcessExit(void)
+{
+  _exit(0);
+}
+
+/*--------------------------------------------------------------------------*/
 static pid_t kwsysProcessFork(kwsysProcess* cp,
                               kwsysProcessCreateInformation* si)
 {
@@ -2257,7 +2263,7 @@
               (errno == EINTR));
 
         /* Exit without cleanup.  The parent holds all resources.  */
-        _exit(0);
+        kwsysProcessExit();
         return 0; /* Never reached, but avoids SunCC warning.  */
         }
       }
@@ -2306,8 +2312,13 @@
   DIR* procdir;
 #endif
 
-  /* Suspend the process to be sure it will not create more children.  */
-  kill(process_id, SIGSTOP);
+  /* Kill the process now to make sure it does not create more
+     children.  Do not reap it yet so we can identify its existing
+     children.  There is a small race condition here.  If the child
+     forks after we begin looking for children below but before it
+     receives this kill signal we might miss a child.  Also we might
+     not be able to catch up to a fork bomb.  */
+  kill(process_id, SIGKILL);
 
   /* Kill all children if we can find them.  */
 #if defined(__linux__) || defined(__CYGWIN__)
@@ -2395,9 +2406,6 @@
       }
 #endif
     }
-
-  /* Kill the process.  */
-  kill(process_id, SIGKILL);
 }
 
 /*--------------------------------------------------------------------------*/

Index: System.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/System.c,v
retrieving revision 1.6
retrieving revision 1.6.26.1
diff -u -d -r1.6 -r1.6.26.1
--- System.c	25 Oct 2006 15:23:04 -0000	1.6
+++ System.c	17 May 2007 14:24:37 -0000	1.6.26.1
@@ -287,6 +287,15 @@
         ++size;
         }
       }
+    else if(*c == '%')
+      {
+      if(flags & kwsysSystem_Shell_Flag_VSIDE)
+        {
+        /* In a VS IDE a percent is written %% so we need one extra
+           characters.  */
+        size += 1;
+        }
+      }
     }
 
   /* Check whether the argument needs surrounding quotes.  */
@@ -432,6 +441,20 @@
         *out++ = '#';
         }
       }
+    else if(*c == '%')
+      {
+      if(flags & kwsysSystem_Shell_Flag_VSIDE)
+        {
+        /* In a VS IDE a percent is written %%.  */
+        *out++ = '%';
+        *out++ = '%';
+        }
+      else
+        {
+        /* Otherwise a percent is written just %. */
+        *out++ = '%';
+        }
+      }
     else
       {
       /* Store this character.  */



More information about the Cmake-commits mailing list