]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Fix: do not close file on mmap (#1017)
authorslaren <redacted>
Sun, 16 Apr 2023 19:27:38 +0000 (21:27 +0200)
committerGitHub <redacted>
Sun, 16 Apr 2023 19:27:38 +0000 (21:27 +0200)
llama_util.h

index d2110ebb4f6422061735f0616b1a16c3bb7434d7..c92c0cc7148d86ffb7817bc06fad43ad29225ed2 100755 (executable)
@@ -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));
         }