summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-25 18:02:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-25 18:02:11 (GMT)
commitc5baf18a404a9713e1b75161855cacbfec32fcf2 (patch)
tree4e0abcbb51224f859308e28ffaa61652030c172a /read-cache.c
parentc53312583b2d25b6ed5f0aa421993795743d1da6 (diff)
parent9ca0aaf6de357d46916d81ca40c47886092fe610 (diff)
downloadgit-c5baf18a404a9713e1b75161855cacbfec32fcf2.zip
git-c5baf18a404a9713e1b75161855cacbfec32fcf2.tar.gz
git-c5baf18a404a9713e1b75161855cacbfec32fcf2.tar.bz2
Merge branch 'jk/diagnose-config-mmap-failure' into maint
The configuration reader/writer uses mmap(2) interface to access the files; when we find a directory, it barfed with "Out of memory?". * jk/diagnose-config-mmap-failure: xmmap(): drop "Out of memory?" config.c: rewrite ENODEV into EISDIR when mmap fails config.c: avoid xmmap error messages config.c: fix mmap leak when writing config read-cache.c: drop PROT_WRITE from mmap of index
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 36ff89f..bf32270 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1540,7 +1540,7 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
if (mmap_size < sizeof(struct cache_header) + 20)
die("index file smaller than expected");
- mmap = xmmap(NULL, mmap_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+ mmap = xmmap(NULL, mmap_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (mmap == MAP_FAILED)
die_errno("unable to map index file");
close(fd);