Merge pull request #170 from mmcco/master

mmap(2) returns MAP_FAILED, not NULL, not failure
pull/585/head
YuQing 2022-09-11 21:04:18 +08:00 committed by GitHub
commit 4dce44665d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -369,7 +369,7 @@ static int load_file_contents()
files[i].file_buff = mmap(NULL, file_size, PROT_READ, \ files[i].file_buff = mmap(NULL, file_size, PROT_READ, \
MAP_SHARED, files[i].fd, 0); MAP_SHARED, files[i].fd, 0);
if (files[i].file_buff == NULL) if (files[i].file_buff == MAP_FAILED)
{ {
fprintf(stderr, "file: "__FILE__", line: %d, " \ fprintf(stderr, "file: "__FILE__", line: %d, " \
"mmap file %s fail, " \ "mmap file %s fail, " \