Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions programs/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,11 @@ static size_t FIO_setDictBufferMMap(FIO_Dict_t* dict, const char* fileName, FIO_
}

fileSize = UTIL_getFileSizeStat(dictFileStat);
if (fileSize == UTIL_FILESIZE_UNKNOWN) {
EXM_THROW(35, "Could not determine size of dictionary %s", fileName);
}
if (fileSize == 0) return 0;

{
size_t const dictSizeMax = prefs->patchFromMode ? prefs->memLimit : DICTSIZE_MAX;
if (fileSize > dictSizeMax) {
Expand All @@ -1049,6 +1054,7 @@ static size_t FIO_setDictBufferMMap(FIO_Dict_t* dict, const char* fileName, FIO_
}
}


*bufferPtr = mmap(NULL, (size_t)fileSize, PROT_READ, MAP_PRIVATE, fileHandle, 0);
if (*bufferPtr == MAP_FAILED) {
EXM_THROW(34, "%s", strerror(errno))
Expand Down
Loading