This fixes my previous fix. The position to read can be completelly random so I have to first cache the current

position before calling _kern_read() and reset it afterwards.

*NOW* this fixes bug #1200 in all cases.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23829 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Bruno G. Albuquerque
2008-02-02 17:59:33 +00:00
parent 3debfe5186
commit 835b8e688a
+2 -1
View File
@@ -361,8 +361,9 @@ BFile::ReadAt(off_t location, void *buffer, size_t size)
// ReadAt() is not supposed to move the current position on the file.
// Tested on BeOS R5 and Zeta.
off_t curPos = Position(); // Cache current position.
ssize_t result = _kern_read(get_fd(), location, buffer, size);
Seek(-result, SEEK_CUR); // Resets file position.
Seek(curPos, SEEK_SET); // Resets file position.
return result;
}