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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user