fix stupid mmap bug reported by simon

This was SVN commit r387.
This commit is contained in:
janwas 2004-06-03 14:20:09 +00:00
parent 0b3d0c9e5c
commit c15300446e

View File

@ -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;