diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-06-25 11:02:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-25 11:02:11 -0700 |
commit | c5baf18a404a9713e1b75161855cacbfec32fcf2 (patch) | |
tree | 4e0abcbb51224f859308e28ffaa61652030c172a /read-cache.c | |
parent | c53312583b2d25b6ed5f0aa421993795743d1da6 (diff) | |
parent | 9ca0aaf6de357d46916d81ca40c47886092fe610 (diff) | |
download | git-c5baf18a404a9713e1b75161855cacbfec32fcf2.tar.gz |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c index 36ff89f29e..bf322708f0 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); |