From 781411ed46400f95c45c5ca103769288025b39d6 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 09:58:06 +0100 Subject: trivial: O_EXCL makes O_TRUNC redundant Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apply.c') diff --git a/apply.c b/apply.c index d5e7bfdb4d..9eba034e5d 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) { -- cgit v1.2.3