Browse Source

Merge branch 'backport-kwsys-cygwin-fixes' into release

Brad King 11 years ago
parent
commit
0aa41c7b94
2 changed files with 11 additions and 2 deletions
  1. 6 0
      Source/kwsys/ProcessUNIX.c
  2. 5 2
      Source/kwsys/SystemTools.cxx

+ 6 - 0
Source/kwsys/ProcessUNIX.c

@@ -2413,6 +2413,12 @@ static void kwsysProcessKill(pid_t process_id)
   /* Suspend the process to be sure it will not create more children.  */
   kill(process_id, SIGSTOP);
 
+#if defined(__CYGWIN__)
+  /* Some Cygwin versions seem to need help here.  Give up our time slice
+     so that the child can process SIGSTOP before we send SIGKILL.  */
+  usleep(1);
+#endif
+
   /* Kill all children if we can find them.  */
 #if defined(__linux__) || defined(__CYGWIN__)
   /* First try using the /proc filesystem.  */

+ 5 - 2
Source/kwsys/SystemTools.cxx

@@ -92,7 +92,7 @@ extern char **environ;
 #endif
 
 #ifdef __CYGWIN__
-extern "C" void cygwin_conv_to_win32_path(const char *path, char *win32_path);
+# include <sys/cygwin.h>
 #endif
 
 // getpwnam doesn't exist on Windows and Cray Xt3/Catamount
@@ -1110,7 +1110,10 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path)
     }
   else
     {
-    cygwin_conv_to_win32_path(path, win32_path);
+    if(cygwin_conv_path(CCP_POSIX_TO_WIN_A, path, win32_path, MAX_PATH) != 0)
+      {
+      win32_path[0] = 0;
+      }
     SystemToolsTranslationMap::value_type entry(path, win32_path);
     SystemTools::Cyg2Win32Map->insert(entry);
     }