Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrés G. Aragoneses <knocte@gmail.com>2009-02-25 05:28:14 +0300
committerAndrés G. Aragoneses <knocte@gmail.com>2009-02-25 05:28:14 +0300
commit5bb70a10306527fdf8fcccb9c4a077bad7c5b583 (patch)
treecf2403e247aeedb0e11b049fc03f5326c6628328 /mcs/class/System/System.Diagnostics/Process.cs
parent560bc6d36dd2dbffff761ec942f2dfe3c947d902 (diff)
* Test/System.Diagnostics/ProcessTest.cs: New tests for bug 477943.
* System.Diagnostics/Process.cs: Throw IOEs instead of normal exceptions. Fixes bug 477943. svn path=/trunk/mcs/; revision=127932
Diffstat (limited to 'mcs/class/System/System.Diagnostics/Process.cs')
-rw-r--r--mcs/class/System/System.Diagnostics/Process.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs
index a26719e84a5..0f511250be2 100644
--- a/mcs/class/System/System.Diagnostics/Process.cs
+++ b/mcs/class/System/System.Diagnostics/Process.cs
@@ -561,13 +561,17 @@ namespace System.Diagnostics {
public string ProcessName {
get {
if(process_name==null) {
+
+ if (process_handle == IntPtr.Zero)
+ throw new InvalidOperationException ("No process is associated with this object.");
+
process_name=ProcessName_internal(process_handle);
/* If process_name is _still_
* null, assume the process
* has exited
*/
if (process_name == null)
- throw new SystemException("The process has exited");
+ throw new InvalidOperationException ("Process has exited, so the requested information is not available.");
/* Strip the suffix (if it
* exists) simplistically