summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-01-06 04:52:50 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-01-06 04:52:50 (GMT)
commit92e802c6ccb96d1b5e8561b0a136d43d82253293 (patch)
tree9b6c265d69d1dc8bcce36c86a44674cfb010a6d7 /apply.c
parent17dff84b5e745ba17a5b3ae5591d79f96b165d48 (diff)
parentc1fe2fe4fe685e0587c3949f953aab726de88994 (diff)
downloadgit-c90d90397e392f699f85c3c288f7cc8459322df3.zip
git-c90d90397e392f699f85c3c288f7cc8459322df3.tar.gz
git-c90d90397e392f699f85c3c288f7cc8459322df3.tar.bz2
GIT 1.0.7v1.0.7
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apply.c b/apply.c
index d5e7bfd..c471a82 100644
--- a/apply.c
+++ b/apply.c
@@ -1588,7 +1588,7 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf,
if (S_ISLNK(mode))
return symlink(buf, path);
- fd = open(path, O_CREAT | O_EXCL | O_WRONLY | O_TRUNC, (mode & 0100) ? 0777 : 0666);
+ fd = open(path, O_CREAT | O_EXCL | O_WRONLY, (mode & 0100) ? 0777 : 0666);
if (fd < 0)
return -1;
while (size) {
@@ -1635,7 +1635,8 @@ static void create_one_file(const char *path, unsigned mode, const char *buf, un
}
if (errno != EEXIST)
break;
- }
+ ++nr;
+ }
}
die("unable to write file %s mode %o", path, mode);
}