Skip to content

Commit 61d5df6

Browse files
committed
DeduplicateStdioHandles() should inherit
The duplicated handles in DeduplicateStdioHandles() should be inheritable. Otherwise sys_fork_nt_parent() will pass non-inheritable handles to CreateProcess().
1 parent f1e83d5 commit 61d5df6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/runtime/winmain.greg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ abi static void DeduplicateStdioHandles(void) {
147147
int64_t h2 = __imp_GetStdHandle(kNtStdio[j]);
148148
if (h1 == h2) {
149149
int64_t h3;
150-
__imp_DuplicateHandle(-1, h2, -1, &h3, 0, false,
150+
__imp_DuplicateHandle(-1, h2, -1, &h3, 0, true,
151151
kNtDuplicateSameAccess);
152152
__imp_SetStdHandle(kNtStdio[j], h3);
153153
}

0 commit comments

Comments
 (0)