提交 520fc241 编写于 作者: L Linus Torvalds

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. 
上级 b0fe89ca
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册