diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-06-11 09:29:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-11 09:29:55 -0700 |
commit | dee47925c1d001947cf9a099e1cb883835f90c64 (patch) | |
tree | 43b49f39956a69276de2aa25c956868cc8ec675c /read-cache.c | |
parent | 8f436d1374c7b8bd29118bd6344520dbaf83594b (diff) | |
parent | 9ca0aaf6de357d46916d81ca40c47886092fe610 (diff) | |
download | git-dee47925c1d001947cf9a099e1cb883835f90c64.tar.gz |
Merge branch 'jk/diagnose-config-mmap-failure'
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c index 723d48dddf..5dee4e2b7f 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1562,7 +1562,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); |