win32: do not inherit file descriptors

This commit is contained in:
Edward Thomson 2017-04-03 23:05:53 +01:00
parent d5e6ca1e4a
commit 1069ad3c54

View File

@ -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) {