summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-03-24 08:26:33 +0100
committerGitHub <noreply@github.com>2017-03-24 08:26:33 +0100
commit1d39a603198e2b93a15d4e744fa664b56e8b464d (patch)
tree8b60c492a2af19a0c9c87cfc264399fc9fac2636
parentfa86a095cbde3945e6c9fba0efb757e24b03652e (diff)
parent4a26915d34414709bfb93a688ac9ae93dbe5828e (diff)
downloadlibgit2-1d39a603198e2b93a15d4e744fa664b56e8b464d.tar.gz
Merge pull request #4175 from libgit2/ethomson/dont_trunc_and_excl
git_futils: don't O_EXCL and O_TRUNC
-rw-r--r--src/fileops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 28f414f23..ad2a988a9 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -66,8 +66,8 @@ int git_futils_creat_withpath(const char *path, const mode_t dirmode, const mode
int git_futils_creat_locked(const char *path, const mode_t mode)
{
- int fd = p_open(path, O_WRONLY | O_CREAT | O_TRUNC |
- O_EXCL | O_BINARY | O_CLOEXEC, mode);
+ int fd = p_open(path, O_WRONLY | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC,
+ mode);
if (fd < 0) {
int error = errno;