Correctly handle mmap() failure (#21062)
This commit is contained in:
parent
35c5181151
commit
1dd95fcb8b
|
@ -553,6 +553,8 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
|
|||
{
|
||||
#if defined(HAVE_MMAP) || defined(__CYGWIN__)
|
||||
cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
if (cache == MAP_FAILED)
|
||||
cache = NULL;
|
||||
#elif defined(_WIN32)
|
||||
{
|
||||
HANDLE hFileMap;
|
||||
|
|
Loading…
Reference in New Issue