summaryrefslogtreecommitdiff
path: root/src/posix.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-06-22 20:58:32 -0700
committerRussell Belfer <rb@github.com>2013-06-22 20:58:32 -0700
commit3d3ea4dc564922a3662298a7cfc2fc8b24149901 (patch)
treefdfc6507cad967fa809d0596f9ef097c0a74c22f /src/posix.c
parent9f1b2c5cb79526f274c0c72eed56f9da0efb0321 (diff)
downloadlibgit2-3d3ea4dc564922a3662298a7cfc2fc8b24149901.tar.gz
Add O_CLOEXEC to open calls
Diffstat (limited to 'src/posix.c')
-rw-r--r--src/posix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/posix.c b/src/posix.c
index 5d526d33c..b75109b83 100644
--- a/src/posix.c
+++ b/src/posix.c
@@ -111,12 +111,12 @@ int p_open(const char *path, int flags, ...)
va_end(arg_list);
}
- return open(path, flags | O_BINARY, mode);
+ return open(path, flags | O_BINARY | O_CLOEXEC, mode);
}
int p_creat(const char *path, mode_t mode)
{
- return open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, mode);
+ return open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_CLOEXEC, mode);
}
int p_getcwd(char *buffer_out, size_t size)