Bläddra i källkod

[Process] Do not count the output/error wait in the timeout of WaitForExit

Ludovic Henry 10 år sedan
förälder
incheckning
0d7364c4e4
1 ändrade filer med 4 tillägg och 28 borttagningar
  1. 4 28
      mcs/class/System/System.Diagnostics/Process.cs

+ 4 - 28
mcs/class/System/System.Diagnostics/Process.cs

@@ -1216,38 +1216,14 @@ namespace System.Diagnostics {
 			if (process_handle == IntPtr.Zero)
 				throw new InvalidOperationException ("No process is associated with this object.");
 
-			DateTime start = DateTime.UtcNow;
-
 			if (!WaitForExit_internal (process_handle, ms))
 				return false;
 
-			if (ms >= 0) {
-				ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
-				if (ms <= 0)
-					return false;
-			}
-
-			if (async_output != null && !async_output.IsCompleted) {
-				if (false == async_output.AsyncWaitHandle.WaitOne (ms, false))
-					return false; // Timed out
+			if (async_output != null && !async_output.IsCompleted)
+				async_output.AsyncWaitHandle.WaitOne ();
 
-				if (ms >= 0) {
-					ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
-					if (ms <= 0)
-						return false;
-				}
-			}
-
-			if (async_error != null && !async_error.IsCompleted) {
-				if (false == async_error.AsyncWaitHandle.WaitOne (ms, false))
-					return false; // Timed out
-
-				if (ms >= 0) {
-					ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
-					if (ms <= 0)
-						return false;
-				}
-			}
+			if (async_error != null && !async_error.IsCompleted)
+				async_error.AsyncWaitHandle.WaitOne ();
 
 			OnExited ();