FileStream.cs: Set buf_start to actual initial position when creating FileStreams...
authorKornél Pál <kornelpal@gmail.com>
Sat, 24 Dec 2005 09:00:02 +0000 (09:00 -0000)
committerKornél Pál <kornelpal@gmail.com>
Sat, 24 Dec 2005 09:00:02 +0000 (09:00 -0000)
svn path=/trunk/mcs/; revision=54831

mcs/class/corlib/System.IO/ChangeLog
mcs/class/corlib/System.IO/FileStream.cs

index 3919c3817ca487e8ba3a3a52e37a9796367a3a5b..cba434cfb48171e2acc24c9bb9eefe9079144b38 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-24  Kornél Pál  <kornelpal@hotmail.com>
+
+       * FileStream.cs: Set buf_start to actual initial position when creating
+         FileStreams from handles.
+
 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
 
        * DirectoryInfo.cs: Fixed #77090 to fix /home parent to be / (and not
index 945f995d682a83bf69cd8e2612f102eae1dcd7c8..31031374ea4958d686490a83912be964cd956798 100644 (file)
@@ -94,6 +94,13 @@ namespace System.IO
 
                        InitBuffer (bufferSize, noBuffering);
 
+                       if (canseek) {
+                               buf_start = MonoIO.Seek (handle, 0, SeekOrigin.Current, out error);
+                               if (error != MonoIOError.ERROR_SUCCESS) {
+                                       throw MonoIO.GetException (name, error);
+                               }
+                       }
+
                        /* Can't set append mode */
                        this.append_startpos=0;
                }