Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
adebcb16
Commit
adebcb16
authored
May 16, 2014
by
Russell Belfer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2360 from phkelley/noinherit
Win32: Supply _O_NOINHERIT when calling _wopen
parents
228272ef
f0b820dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
src/win32/posix_w32.c
+11
-2
No files found.
src/win32/posix_w32.c
View file @
adebcb16
...
...
@@ -19,6 +19,15 @@
# define FILE_NAME_NORMALIZED 0
#endif
/* Options which we always provide to _wopen.
*
* _O_BINARY - Raw access; no translation of CR or LF characters
* _O_NOINHERIT - Do not mark the created handle as inheritable by child processes.
* The Windows default is 'not inheritable', but the CRT's default (following
* POSIX convention) is 'inheritable'. We have no desire for our handles to be
* inheritable on Windows, so specify the flag to get default behavior back. */
#define STANDARD_OPEN_FLAGS (_O_BINARY | _O_NOINHERIT)
/* GetFinalPathNameByHandleW signature */
typedef
DWORD
(
WINAPI
*
PFGetFinalPathNameByHandleW
)(
HANDLE
,
LPWSTR
,
DWORD
,
DWORD
);
...
...
@@ -317,7 +326,7 @@ int p_open(const char *path, int flags, ...)
va_end
(
arg_list
);
}
return
_wopen
(
buf
,
flags
|
_O_BINARY
,
mode
);
return
_wopen
(
buf
,
flags
|
STANDARD_OPEN_FLAGS
,
mode
);
}
int
p_creat
(
const
char
*
path
,
mode_t
mode
)
...
...
@@ -327,7 +336,7 @@ int p_creat(const char *path, mode_t mode)
if
(
utf8_to_16_with_errno
(
buf
,
path
)
<
0
)
return
-
1
;
return
_wopen
(
buf
,
_O_WRONLY
|
_O_CREAT
|
_O_TRUNC
|
_O_BINARY
,
mode
);
return
_wopen
(
buf
,
_O_WRONLY
|
_O_CREAT
|
_O_TRUNC
|
STANDARD_OPEN_FLAGS
,
mode
);
}
int
p_getcwd
(
char
*
buffer_out
,
size_t
size
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment