Skip to content

Commit

Permalink
Allow writing to the private index file mapping.
Browse files Browse the repository at this point in the history
We now modify the in-memory copy of the index file in "diff-cache", so
we need to add PROT_WRITE.
  • Loading branch information
Linus Torvalds committed Apr 27, 2005
1 parent b0fe89c commit 520fc24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion read-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ int read_cache(void)
size = st.st_size;
errno = EINVAL;
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);
if (-1 == (int)(long)map)
Expand Down

0 comments on commit 520fc24

Please sign in to comment.