Replace off64_t with uint64_t where it makes sense to do so.
It looks like off64_t was propagated through the code from the return type of lseek64(), which isn't appropriate in many of the places we're using it.
This commit is contained in:
@@ -76,8 +76,14 @@ int build_allocation_map(struct bitset * allocation_map, int fd)
|
||||
}
|
||||
|
||||
|
||||
int open_and_mmap(const char* filename, int* out_fd, off64_t *out_size, void **out_map)
|
||||
int open_and_mmap(const char* filename, int* out_fd, uint64_t *out_size, void **out_map)
|
||||
{
|
||||
/*
|
||||
* size and out_size are intentionally of different types.
|
||||
* lseek64() uses off64_t to signal errors in the sign bit.
|
||||
* Since we check for these errors before trying to assign to
|
||||
* *out_size, we know *out_size can never go negative.
|
||||
*/
|
||||
off64_t size;
|
||||
|
||||
/* O_DIRECT should not be used with mmap() */
|
||||
|
Reference in New Issue
Block a user