Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
windows: make file handles non-inheritable by default to match node b…
…ehavior
  • Loading branch information
Igor Zinkovsky committed Sep 14, 2011
1 parent 2931bdc commit 4197fc7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/win/fs.c
Expand Up @@ -133,7 +133,6 @@ static void uv_fs_req_init_sync(uv_loop_t* loop, uv_fs_t* req,
void fs__open(uv_fs_t* req, const char* path, int flags, int mode) {
DWORD access;
DWORD share;
SECURITY_ATTRIBUTES sa;
DWORD disposition;
DWORD attributes;
HANDLE file;
Expand Down Expand Up @@ -168,14 +167,6 @@ void fs__open(uv_fs_t* req, const char* path, int flags, int mode) {
*/
share = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;

sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
if (flags & _O_NOINHERIT) {
sa.bInheritHandle = FALSE;
} else {
sa.bInheritHandle = TRUE;
}

switch (flags & (_O_CREAT | _O_EXCL | _O_TRUNC)) {
case 0:
case _O_EXCL:
Expand Down Expand Up @@ -233,7 +224,7 @@ void fs__open(uv_fs_t* req, const char* path, int flags, int mode) {
file = CreateFileA(path,
access,
share,
&sa,
NULL,
disposition,
attributes,
NULL);
Expand Down Expand Up @@ -407,7 +398,6 @@ void fs__readdir(uv_fs_t* req, const char* path, int flags) {
req->ptr = buf;
req->flags |= UV_FS_FREE_PTR;

done:
SET_REQ_RESULT(req, result);
}

Expand Down

0 comments on commit 4197fc7

Please sign in to comment.