From: slaren Date: Sun, 16 Apr 2023 19:27:38 +0000 (+0200) Subject: Fix: do not close file on mmap (#1017) X-Git-Tag: gguf-v0.4.0~942 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=47f61aaa5f76d04286792e2fbd0c95b659ab2af0;p=pkg%2Fggml%2Fsources%2Fllama.cpp Fix: do not close file on mmap (#1017) --- diff --git a/llama_util.h b/llama_util.h index d2110ebb..c92c0cc7 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)); }