Skip to content

Commit e13966d

Browse files
committed
Merge branch 'vn/xmmap-gently'
Clean-up an error codepath. * vn/xmmap-gently: read-cache.c: do not die if mmap fails
2 parents c7cf2de + 02638d1 commit e13966d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

read-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
21402140
if (mmap_size < sizeof(struct cache_header) + the_hash_algo->rawsz)
21412141
die(_("%s: index file smaller than expected"), path);
21422142

2143-
mmap = xmmap(NULL, mmap_size, PROT_READ, MAP_PRIVATE, fd, 0);
2143+
mmap = xmmap_gently(NULL, mmap_size, PROT_READ, MAP_PRIVATE, fd, 0);
21442144
if (mmap == MAP_FAILED)
21452145
die_errno(_("%s: unable to map index file"), path);
21462146
close(fd);

0 commit comments

Comments
 (0)