Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-06-24 22:21:09 +0400
committerVicent Martí <vicent@github.com>2013-06-24 22:21:09 +0400
commit09ee60c6d40821caec44ab8a769bbae1108cf71a (patch)
treef7b495c63b2b1a5a1baa8b5bf30e4031fb434593 /src/fileops.c
parent6c4dadba4526d90ab74b9b36e788b66afb688feb (diff)
parent3d3ea4dc564922a3662298a7cfc2fc8b24149901 (diff)
Merge pull request #1670 from arrbee/open-cloexec
Add O_CLOEXEC to open calls
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 95b15c604..d5f6acfad 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) {