forked from 0ad/0ad
fix stupid mmap bug reported by simon
This was SVN commit r387.
This commit is contained in:
parent
0b3d0c9e5c
commit
c15300446e
@ -1327,7 +1327,7 @@ int file_map(File* const f, void*& p, size_t& size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int prot = (f->flags & FILE_WRITE)? PROT_WRITE : PROT_READ;
|
const int prot = (f->flags & FILE_WRITE)? PROT_WRITE : PROT_READ;
|
||||||
f->mapping = mmap((void*)0, size, prot, MAP_PRIVATE, f->fd, (off_t)0);
|
f->mapping = mmap((void*)0, f->size, prot, MAP_PRIVATE, f->fd, (off_t)0);
|
||||||
if(!f->mapping)
|
if(!f->mapping)
|
||||||
return ERR_NO_MEM;
|
return ERR_NO_MEM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user