Skip to content

Commit a6d70ab

Browse files
committed
Removed new termio incompatible dup() implementaion with overlapped option
1 parent a8fcb8d commit a6d70ab

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

contrib/win32/win32compat/w32fd.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -690,15 +690,7 @@ w32_dup(int oldfd) {
690690
return -1;
691691
}
692692

693-
if ((oldfd == STDIN_FILENO) && (GetFileType(GetStdHandle(STD_INPUT_HANDLE)) == FILE_TYPE_CHAR)) {
694-
target = CreateFileA("CONIN$", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_FLAG_OVERLAPPED, NULL);
695-
if (target == INVALID_HANDLE_VALUE) {
696-
errno = EOTHER;
697-
debug("dup - ERROR: CreateFile CONIN$ :%d", GetLastError());
698-
return -1;
699-
}
700-
}
701-
else if (!DuplicateHandle(GetCurrentProcess(), src, GetCurrentProcess(), &target, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
693+
if (!DuplicateHandle(GetCurrentProcess(), src, GetCurrentProcess(), &target, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
702694
errno = EOTHER;
703695
debug("dup - ERROR: DuplicatedHandle() :%d", GetLastError());
704696
return -1;

0 commit comments

Comments
 (0)