Allow writing to the private index file mapping.
We now modify the in-memory copy of the index file in "diff-cache", so we need to add PROT_WRITE.maint
parent
b0fe89caeb
commit
520fc2415e
|
@ -198,7 +198,7 @@ int read_cache(void)
|
||||||
size = st.st_size;
|
size = st.st_size;
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
if (size >= sizeof(struct cache_header) + 20)
|
if (size >= sizeof(struct cache_header) + 20)
|
||||||
map = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
|
map = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
if (-1 == (int)(long)map)
|
if (-1 == (int)(long)map)
|
||||||
|
|
Loading…
Reference in New Issue