ReadAt() should not change the file position. Tested under R5 and Zeta. This fixes bug #1200 (Received emails are

missing attributes).

I hope nothing relies on the previously broken behaviour.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23828 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Bruno G. Albuquerque
2008-02-02 17:38:55 +00:00
parent e6b30aee0f
commit 3debfe5186
+7 -1
View File
@@ -358,7 +358,13 @@ BFile::ReadAt(off_t location, void *buffer, size_t size)
return InitCheck();
if (location < 0)
return B_BAD_VALUE;
return _kern_read(get_fd(), location, buffer, size);
// ReadAt() is not supposed to move the current position on the file.
// Tested on BeOS R5 and Zeta.
ssize_t result = _kern_read(get_fd(), location, buffer, size);
Seek(-result, SEEK_CUR); // Resets file position.
return result;
}
// Write