From 47f61aaa5f76d04286792e2fbd0c95b659ab2af0 Mon Sep 17 00:00:00 2001 From: slaren <2141330+slaren@users.noreply.github.com> Date: Sun, 16 Apr 2023 21:27:38 +0200 Subject: [PATCH] Fix: do not close file on mmap (#1017) --- 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)); }