diff options
Diffstat (limited to 'src/fileops.c')
-rw-r--r-- | src/fileops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fileops.c b/src/fileops.c index ae240fcd2..1f58fa5cd 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -61,9 +61,11 @@ int git_futils_creat_locked(const char *path, const mode_t mode) wchar_t buf[GIT_WIN_PATH]; git__utf8_to_16(buf, GIT_WIN_PATH, path); - fd = _wopen(buf, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_EXCL, mode); + fd = _wopen(buf, O_WRONLY | O_CREAT | O_TRUNC | + O_EXCL | O_BINARY | O_CLOEXEC, mode); #else - fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_EXCL, mode); + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | + O_EXCL | O_BINARY | O_CLOEXEC, mode); #endif if (fd < 0) { |