Cygwin: close_all_files: Do not duplicate stderr for write pipe.

- Currently, the stderr handle is duplicated in close_all_files().
  This interferes the handle counting for detecting closure of read
  pipe, which is introduced by commit f79a4611. This patch stops
  duplicating stderr handle if it is write pipe.
This commit is contained in:
Takashi Yano 2021-09-16 20:50:54 +09:00 committed by Ken Brown
parent 18fab2f834
commit 350806f882
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ close_all_files (bool norelease)
if (cfd >= 0)
{
debug_only_printf ("closing fd %d", i);
if (i == 2)
if (i == 2 && cfd->get_dev () != FH_PIPEW)
DuplicateHandle (GetCurrentProcess (), cfd->get_output_handle (),
GetCurrentProcess (), &h,
0, false, DUPLICATE_SAME_ACCESS);