Was returning an error when attempting to read past the end of
the file. Apparently one must return success but report 0 bytes read. This should fix the tracker file copy bug Marcus found. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4612 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -57,8 +57,13 @@ Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
|
|||||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_HIGH_VOLUME, "Icb",
|
DEBUG_INIT_ETC(CF_PUBLIC | CF_HIGH_VOLUME, "Icb",
|
||||||
("pos: %lld, buffer: %p, length: (%p)->%ld", pos, buffer, length, (length ? *length : 0)));
|
("pos: %lld, buffer: %p, length: (%p)->%ld", pos, buffer, length, (length ? *length : 0)));
|
||||||
|
|
||||||
if (!buffer || !length || uint64(pos) >= Length())
|
if (!buffer || !length)
|
||||||
RETURN(B_BAD_VALUE);
|
RETURN(B_BAD_VALUE);
|
||||||
|
|
||||||
|
if (uint64(pos) >= Length()) {
|
||||||
|
*length = 0;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
switch (IcbTag().descriptor_flags()) {
|
switch (IcbTag().descriptor_flags()) {
|
||||||
case ICB_DESCRIPTOR_TYPE_SHORT: {
|
case ICB_DESCRIPTOR_TYPE_SHORT: {
|
||||||
|
|||||||
Reference in New Issue
Block a user