Cygwin: fix inheritence of select_sem on write side of pipe

select_sem gets created on the read side with inheritence settings
depending on the O_CLOEXEC flag.  Then it gets duplicated to the write
side with unconditional inheritence.  Fix that.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2021-09-13 19:33:56 +02:00
parent 0063ffeb73
commit c48361ad9e
1 changed files with 1 additions and 1 deletions

View File

@ -790,7 +790,7 @@ fhandler_pipe::create (fhandler_pipe *fhs[2], unsigned psize, int mode)
if (fhs[0]->select_sem)
DuplicateHandle (GetCurrentProcess (), fhs[0]->select_sem,
GetCurrentProcess (), &fhs[1]->select_sem,
0, 1, DUPLICATE_SAME_ACCESS);
0, !(mode & O_CLOEXEC), DUPLICATE_SAME_ACCESS);
}
debug_printf ("%R = pipe([%p, %p], %d, %y)", res, fhs[0], fhs[1], psize, mode);