4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-08 10:09:32 +08:00

Cygwin: AF_UNIX: fix cherry-pick

This commit is contained in:
Ken Brown 2021-03-31 11:29:13 -04:00
parent 3a39f2cb68
commit 0bfca3c802

View File

@ -691,22 +691,10 @@ dtable::dup_worker (fhandler_base *oldfh, int flags, DWORD src_pid)
if (src_pid && oldfh->archetype
&& !(newfh->archetype = find_archetype (oldfh->dev ())))
need_new_arch = true;
newfh->pc.close_conv_handle ();
if (oldfh->dup (newfh, flags))
{
delete newfh;
newfh = NULL;
debug_printf ("oldfh->dup failed");
}
else
{
/* Don't increment refcnt here since we don't know if this is a
allocated fd. So we leave this chore to the caller. */
if (!oldfh->archetype)
newfh->set_handle (NULL);
newfh->pc.reset_conv_handle ();
newfh->pc.close_conv_handle ();
if (oldfh->dup (newfh, flags, src_pid))
{
delete newfh;