Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
trivial: O_EXCL makes O_TRUNC redundant
[gitweb.git]
/
apply.c
diff --git
a/apply.c
b/apply.c
index d5e7bfdb4de1fe7990ae11e190537fd1c490d54c..9eba034e5d77bd54c7b6343ad54fb3626aa59c37 100644
(file)
--- 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) {