Fix some additional Windows TTY issues

This commit is contained in:
Justine Tunney 2023-10-03 23:53:59 -07:00
parent f26a280cda
commit 1694edf85c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
12 changed files with 107 additions and 43 deletions

View file

@ -71,6 +71,10 @@ textwindows int sys_dup_nt(int oldfd, int newfd, int flags, int start) {
if (g_fds.p[oldfd].kind == kFdSocket && _weaken(_dupsockfd)) {
g_fds.p[newfd].extra =
(intptr_t)_weaken(_dupsockfd)((struct SockFd *)g_fds.p[oldfd].extra);
} else if (g_fds.p[oldfd].kind == kFdConsole) {
unassert(DuplicateHandle(proc, g_fds.p[oldfd].extra, proc,
&g_fds.p[newfd].extra, 0, false,
kNtDuplicateSameAccess));
} else {
g_fds.p[newfd].extra = g_fds.p[oldfd].extra;
}