From 9331fad93b9bf5d9a2ffc6ee1d8d926e171b7b45 Mon Sep 17 00:00:00 2001 From: Slaren <2141330+slaren@users.noreply.github.com> Date: Sun, 16 Apr 2023 20:38:52 +0200 Subject: [PATCH] Fix: do not close file on mmap --- llama_util.h | 1 - 1 file changed, 1 deletion(-) diff --git a/llama_util.h b/llama_util.h index d2110ebb4..c92c0cc71 100755 --- a/llama_util.h +++ b/llama_util.h @@ -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)); }