[Process] Fix HasExited for non-child process
authorLudovic Henry <ludovic@xamarin.com>
Thu, 14 Apr 2016 09:53:56 +0000 (11:53 +0200)
committerLudovic Henry <ludovic@xamarin.com>
Thu, 14 Apr 2016 11:15:21 +0000 (13:15 +0200)
NativeMethods.GetExitCodeProcess would inherently be broken on Unix platforms for non-child processes as it can't succesfully get the exit code. This would in turn break Process.HasExited, which should not break, as it is possible to check if a non-child process is alive or dead.

external/referencesource
mono/io-layer/processes.c

index 1f9f4ae3de23a100d871eae9f12da22d9353b182..5fe23f0bebb8de212394bba01333881c65b01d6f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1f9f4ae3de23a100d871eae9f12da22d9353b182
+Subproject commit 5fe23f0bebb8de212394bba01333881c65b01d6f
index 7e46c31ba3e1564a9323022f9a0e3542b5f71fca..0157e92f5be08fc6b56f0590393d9f0030d5917f 100644 (file)
@@ -1287,7 +1287,8 @@ GetExitCodeProcess (gpointer process, guint32 *code)
                        *code = STILL_ACTIVE;
                        return TRUE;
                } else {
-                       return FALSE;
+                       *code = -1;
+                       return TRUE;
                }
        }