summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-04-03 23:05:53 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2017-04-03 23:13:38 +0100
commit1069ad3c54c9aab24f5d5a3c0a84c0b8a599b251 (patch)
tree9986d5f63bf870bd81709e652981996c0ea7de5c /src/win32
parentd5e6ca1e4a3f21ef9eb94c9e74cc4afb77194751 (diff)
downloadlibgit2-1069ad3c54c9aab24f5d5a3c0a84c0b8a599b251.tar.gz
win32: do not inherit file descriptors
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/posix_w32.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index 4943ce202..874892eb6 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -440,7 +440,14 @@ GIT_INLINE(int) open_once(
DWORD attributes,
int osf_flags)
{
- HANDLE handle = CreateFileW(path, access, sharing, NULL,
+ SECURITY_ATTRIBUTES security;
+ int fd;
+
+ security.nLength = sizeof(SECURITY_ATTRIBUTES);
+ security.lpSecurityDescriptor = NULL;
+ security.bInheritHandle = 0;
+
+ HANDLE handle = CreateFileW(path, access, sharing, &security,
creation_disposition, attributes, 0);
if (handle == INVALID_HANDLE_VALUE) {