Fixed the value of map->p_fd_offset when a read() fails or is

abbreviated.
This commit is contained in:
Wayne Davison
2006-04-08 16:37:50 +00:00
parent f61ab01d96
commit e3db43ffe5

View File

@@ -232,7 +232,6 @@ char *map_ptr(struct map_struct *map, OFF_T offset, int32 len)
}
map->p_fd_offset = read_start;
}
map->p_fd_offset += read_size;
map->p_offset = window_start;
map->p_len = window_size;
@@ -246,6 +245,7 @@ char *map_ptr(struct map_struct *map, OFF_T offset, int32 len)
memset(map->p + read_offset, 0, read_size);
break;
}
map->p_fd_offset += nread;
read_offset += nread;
read_size -= nread;
}