Fix Process.CancelErrorRead
authorTammo 'kb' Hinrichs <kb@kebby.org>
Tue, 18 Mar 2014 11:08:48 +0000 (12:08 +0100)
committerTammo 'kb' Hinrichs <kb@kebby.org>
Tue, 18 Mar 2014 11:45:11 +0000 (12:45 +0100)
Fixed CancelErrorRead throwing an InvalidOperationException because it checked the wrong output stream (probably a cut&paste mistake).

mcs/class/System/System.Diagnostics/Process.cs

index e08d79e0f10b97df5d49e13bbc1075a36df682a4..515903d3fe01c610e607cc0d12e3fab7167d6d8b 100644 (file)
@@ -1517,8 +1517,8 @@ namespace System.Diagnostics {
                [ComVisibleAttribute(false)] 
                public void CancelErrorRead ()
                {
-                       if (process_handle == IntPtr.Zero || output_stream == null || StartInfo.RedirectStandardOutput == false)
-                               throw new InvalidOperationException ("Standard output has not been redirected or process has not been started.");
+                       if (process_handle == IntPtr.Zero || error_stream == null || StartInfo.RedirectStandardError == false)
+                               throw new InvalidOperationException ("Standard error has not been redirected or process has not been started.");
 
                        if ((async_mode & AsyncModes.SyncOutput) != 0)
                                throw new InvalidOperationException ("OutputStream is not enabled for asynchronous read operations.");