[patch from Kelvin Delbarre] Fix file corruption experienced when doing random-access

file I/O to the external filesystem. The application-specified ioPosMode parameter must
be masked off appropriately in extfs.cpp:fs_set_fpos(), as is done elsewhere in the file.
This commit is contained in:
asvitkine 2008-06-20 00:39:47 +00:00
parent 1002714623
commit 682853da42

View File

@ -1800,7 +1800,7 @@ static int16 fs_set_fpos(uint32 pb)
return fnOpnErr;
// Set file position
switch (ReadMacInt16(pb + ioPosMode)) {
switch (ReadMacInt16(pb + ioPosMode) & 3) {
case fsFromStart:
if (lseek(fd, ReadMacInt32(pb + ioPosOffset), SEEK_SET) < 0)
return posErr;