Merge pull request #1923 from lukaszunity/start-managed-process-fix
authorJoão Matos <joao@tritao.eu>
Mon, 27 Jul 2015 15:43:40 +0000 (16:43 +0100)
committerJoão Matos <joao@tritao.eu>
Mon, 27 Jul 2015 15:43:40 +0000 (16:43 +0100)
Process.Start fix for managed program

1  2 
mono/io-layer/processes.c

index fc2eb354bbc86bcf97cf4d8a4cfc2883855b0653,e806bd88654a97a5d93ee23eb95d820bd7827279..5f0805878cf7173c6c492460d6254159a2c3e859
@@@ -178,9 -178,7 +178,9 @@@ is_pid_valid (pid_t pid
  {
        gboolean result = FALSE;
  
 -#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
 +#if defined(HOST_WATCHOS)
 +      result = TRUE; // TODO: Rewrite using sysctl
 +#elif defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
        if (((kill(pid, 0) == 0) || (errno == EPERM)) && pid != 0)
                result = TRUE;
  #elif defined(__HAIKU__)
@@@ -817,11 -815,11 +817,11 @@@ gboolean CreateProcess (const gunichar
  
                if (newapp != NULL) {
                        if (appname != NULL) {
-                               newcmd = utf16_concat (newapp, utf16_space,
+                               newcmd = utf16_concat (utf16_quote, newapp, utf16_quote, utf16_space,
                                                       appname, utf16_space,
                                                       cmdline, NULL);
                        } else {
-                               newcmd = utf16_concat (newapp, utf16_space,
+                               newcmd = utf16_concat (utf16_quote, newapp, utf16_quote, utf16_space,
                                                       cmdline, NULL);
                        }
                        
@@@ -2315,7 -2313,6 +2315,7 @@@ SetProcessWorkingSetSize (gpointer proc
  gboolean
  TerminateProcess (gpointer process, gint32 exitCode)
  {
 +#if defined(HAVE_KILL)
        WapiHandle_process *process_handle;
        int signo;
        int ret;
        }
        
        return (ret == 0);
 +#else
 +      g_error ("kill() is not supported by this platform");
 +      return FALSE;
 +#endif
  }
  
  guint32