Fixed the "famous" VM bug; read_pos() returns the number of bytes read, so

Cache::Read() != B_OK failed if the underlying class used that function.
We can now boot R5 with VM turned on without any problems (what a stupid bug).
As a side effect, you can now also mount volumes on your BFS disk, which was
also broken because of this bug.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1930 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2002-11-14 00:24:31 +00:00
parent e94373bfa0
commit 6f6aedf0b3

View File

@ -447,7 +447,7 @@ Stream<Cache>::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
partial = true;
}
if (Cache::Read(fVolume, run, buffer + bytesRead) != B_OK) {
if (Cache::Read(fVolume, run, buffer + bytesRead) < B_OK) {
*_length = bytesRead;
RETURN_ERROR(B_BAD_VALUE);
}