[Mono-bugs] [Bug 35623][Nor] New - FileStream should not close handle it does not own

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
14 Dec 2002 23:52:31 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by raymond@dotsphinx.com.

http://bugzilla.ximian.com/show_bug.cgi?id=35623

--- shadow/35623	Sat Dec 14 18:52:31 2002
+++ shadow/35623.tmp.13167	Sat Dec 14 18:52:31 2002
@@ -0,0 +1,36 @@
+Bug#: 35623
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: raymond@dotsphinx.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: FileStream should not close handle it does not own
+
+The FileStream class currently does not respect the "owner" parameter that
+can be passed to its constructor. If the file stream does not own the
+handle, it should not close it. 
+
+Suggested patch:
+
+--- FileStream.cs.orig	2002-10-31 16:55:48.000000000 +0100
++++ FileStream.cs	2002-12-15 00:40:15.000000000 +0100
+@@ -350,7 +350,7 @@
+ 		}
+
+ 
+ 		protected virtual void Dispose (bool disposing) {
+-			if (handle != MonoIO.InvalidHandle) {
++			if (owner && handle != MonoIO.InvalidHandle) {
+ 				FlushBuffer ();
+ 
+ 				MonoIOError error;