From 835b8e688acbb817c2cb71c7c840c3402440a17e Mon Sep 17 00:00:00 2001 From: "Bruno G. Albuquerque" Date: Sat, 2 Feb 2008 17:59:33 +0000 Subject: [PATCH] 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 --- src/kits/storage/File.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kits/storage/File.cpp b/src/kits/storage/File.cpp index 39bc89f981..872890bdc9 100644 --- a/src/kits/storage/File.cpp +++ b/src/kits/storage/File.cpp @@ -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; }