diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-29 21:38:12 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-29 21:38:12 +0200 |
commit | 9d98862bf5d0f0557e1a822491bb792abcd022cf (patch) | |
tree | 769e2e3bf1eed795147138ff54ed504ce88d5def /read-cache.c | |
parent | Merge branch 'rm/gpg-program-doc-fix' into maint (diff) | |
parent | read-cache.c: do not die if mmap fails (diff) | |
download | git-9d98862bf5d0f0557e1a822491bb792abcd022cf.tar.xz git-9d98862bf5d0f0557e1a822491bb792abcd022cf.zip |
Merge branch 'vn/xmmap-gently' into maint
Clean-up an error codepath.
* vn/xmmap-gently:
read-cache.c: do not die if mmap fails
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 32816763bd..7b1be1b671 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2140,7 +2140,7 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist) if (mmap_size < sizeof(struct cache_header) + the_hash_algo->rawsz) die(_("%s: index file smaller than expected"), path); - mmap = xmmap(NULL, mmap_size, PROT_READ, MAP_PRIVATE, fd, 0); + mmap = xmmap_gently(NULL, mmap_size, PROT_READ, MAP_PRIVATE, fd, 0); if (mmap == MAP_FAILED) die_errno(_("%s: unable to map index file"), path); close(fd); |