# Patch created by ioman # Date: Mi Mär 2 09:57:50 CET 2005 # Repository: pnetlib # Comments: # # # Added throwing exceptions, when Processes are not started a.s.o. # Like .NET does. # #### End of Preamble #### #### Patch data follows #### Index: System/Diagnostics/Process.cs =================================================================== RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/Diagnostics/Process.cs,v retrieving revision 1.11 diff -c -r1.11 Process.cs *** System/Diagnostics/Process.cs 2 Dec 2003 11:25:29 -0000 1.11 --- System/Diagnostics/Process.cs 2 Mar 2005 08:57:54 -0000 *************** *** 941,946 **** --- 941,953 ---- { throw new Win32Exception(); } + + // Checking errno for error + Errno errno = Process.GetErrno(); + if( errno != Errno.Success ) { + throw new Win32Exception(Process.GetErrnoMessage(errno)); + } + // Wrap up the redirected I/O streams. if(stdinHandle != SocketMethods.GetInvalidHandle()) *************** *** 1140,1145 **** --- 1147,1162 ---- out IntPtr processHandle, out int processID, out IntPtr stdinHandle, out IntPtr stdoutHandle, out IntPtr stderrHandle); + + // Get the last-occurring system error code for the current thread. + [MethodImpl(MethodImplOptions.InternalCall)] + extern public static Errno GetErrno(); + + // Get a descriptive message for an error from the underlying platform. + // Returns null if the platform doesn't have an appropriate message. + [MethodImpl(MethodImplOptions.InternalCall)] + extern public static String GetErrnoMessage(Errno errno); + }; // class Process #### End of Patch data ####