Skip to content

Commit bf1e6da

Browse files
carenasgitster
authored andcommitted
compat: make sure git_mmap is not expected to write
in f48000f ("Yank writing-back support from gitfakemmap.", 2005-10-08) support for writting back changes was removed but the specific prot flag that would be used was not checked for Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]> Acked-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 40f327f commit bf1e6da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t of
44
{
55
size_t n = 0;
66

7-
if (start != NULL || !(flags & MAP_PRIVATE))
7+
if (start != NULL || flags != MAP_PRIVATE || prot != PROT_READ)
88
die("Invalid usage of mmap when built with NO_MMAP");
99

1010
start = xmalloc(length);

0 commit comments

Comments
 (0)