Skip to content

Commit 1d39a60

Browse files
authored
Merge pull request libgit2#4175 from libgit2/ethomson/dont_trunc_and_excl
git_futils: don't O_EXCL and O_TRUNC
2 parents fa86a09 + 4a26915 commit 1d39a60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fileops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ int git_futils_creat_withpath(const char *path, const mode_t dirmode, const mode
6666

6767
int git_futils_creat_locked(const char *path, const mode_t mode)
6868
{
69-
int fd = p_open(path, O_WRONLY | O_CREAT | O_TRUNC |
70-
O_EXCL | O_BINARY | O_CLOEXEC, mode);
69+
int fd = p_open(path, O_WRONLY | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC,
70+
mode);
7171

7272
if (fd < 0) {
7373
int error = errno;

0 commit comments

Comments
 (0)