Fix: do not close file on mmap

This commit is contained in:
Slaren 2023-04-16 20:38:52 +02:00
parent 3173a62eb9
commit 9331fad93b

View file

@ -176,7 +176,6 @@ struct llama_mmap {
flags |= MAP_POPULATE;
#endif
addr = mmap(NULL, file->size, PROT_READ, flags, fd, 0);
close(fd);
if (addr == MAP_FAILED) {
throw format("mmap failed: %s", strerror(errno));
}