server: Don't fail to map a shared section if the final sector is truncated.
This commit is contained in:
parent
6e062a4e08
commit
126bbb3fe3
|
@ -184,6 +184,11 @@ static int build_shared_mapping( struct mapping *mapping, int fd,
|
|||
while (toread)
|
||||
{
|
||||
long res = pread( fd, buffer + file_size - toread, toread, read_pos );
|
||||
if (!res && toread < 0x200) /* partial sector at EOF is not an error */
|
||||
{
|
||||
file_size -= toread;
|
||||
break;
|
||||
}
|
||||
if (res <= 0) goto error;
|
||||
toread -= res;
|
||||
read_pos += res;
|
||||
|
|
Loading…
Reference in New Issue