mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-23 11:00:31 +00:00
DeduplicateStdioHandles() should inherit
The duplicated handles in DeduplicateStdioHandles() should be inheritable. Otherwise sys_fork_nt_parent() will pass non-inheritable handles to CreateProcess().
This commit is contained in:
parent
f1e83d5240
commit
61d5df6e6d
1 changed files with 1 additions and 1 deletions
|
@ -147,7 +147,7 @@ abi static void DeduplicateStdioHandles(void) {
|
||||||
int64_t h2 = __imp_GetStdHandle(kNtStdio[j]);
|
int64_t h2 = __imp_GetStdHandle(kNtStdio[j]);
|
||||||
if (h1 == h2) {
|
if (h1 == h2) {
|
||||||
int64_t h3;
|
int64_t h3;
|
||||||
__imp_DuplicateHandle(-1, h2, -1, &h3, 0, false,
|
__imp_DuplicateHandle(-1, h2, -1, &h3, 0, true,
|
||||||
kNtDuplicateSameAccess);
|
kNtDuplicateSameAccess);
|
||||||
__imp_SetStdHandle(kNtStdio[j], h3);
|
__imp_SetStdHandle(kNtStdio[j], h3);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue