Skip to content

Commit

Permalink
[utils] The fallback mmap should fail if it cannot read the full cont…
Browse files Browse the repository at this point in the history
…ents of a file.
  • Loading branch information
kumpera committed Jan 17, 2014
1 parent 20149a0 commit eb460af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mono/utils/mono-filemap.c
Expand Up @@ -86,6 +86,8 @@ mono_file_map_fileio (size_t length, int flags, int fd, guint64 offset, void **r
return NULL;
}
bytes_read = read (fd, ptr, length);
if (bytes_read != length)
return NULL;
lseek (fd, cur_offset, SEEK_SET);
*ret_handle = NULL;
return ptr;
Expand Down

0 comments on commit eb460af

Please sign in to comment.