Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-27 06:27:27 +0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-27 06:27:27 +0400
commit520fc2415e83c0adfc1186ee922472c338cb4146 (patch)
treeb3cf5da7f8ed3a8bafb2b318eb150827e9970d14 /read-cache.c
parentb0fe89caeb0c37405874bad66702f49ff4977972 (diff)
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.
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 2354e8039b..53f1da815b 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -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)