* fhandler_socket.cc (fhandler_socket::dup): Decrement dtable's

need_fixup_before counter on successful dup.
	* net.cc (cygwin_getpeername): Add file descriptor to debug output.
This commit is contained in:
Corinna Vinschen 2004-08-19 10:58:37 +00:00
parent 6a19fd82fa
commit 82b3018088
3 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2004-08-19 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::dup): Decrement dtable's
need_fixup_before counter on successful dup.
* net.cc (cygwin_getpeername): Add file descriptor to debug output.
2004-08-17 Pierre Humblet <pierre.humblet@ieee.org> 2004-08-17 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler.h (fhandler_dev_dsp:~fhandler_dev_dsp): Delete. * fhandler.h (fhandler_dev_dsp:~fhandler_dev_dsp): Delete.

View File

@ -344,7 +344,10 @@ fhandler_socket::dup (fhandler_base *child)
{ {
fhs->fixup_after_fork (hMainProc); fhs->fixup_after_fork (hMainProc);
if (fhs->get_io_handle() != (HANDLE) INVALID_SOCKET) if (fhs->get_io_handle() != (HANDLE) INVALID_SOCKET)
return 0; {
cygheap->fdtab.inc_need_fixup_before ();
return 0;
}
} }
debug_printf ("WSADuplicateSocket failed, trying DuplicateHandle"); debug_printf ("WSADuplicateSocket failed, trying DuplicateHandle");
} }
@ -363,6 +366,7 @@ fhandler_socket::dup (fhandler_base *child)
} }
VerifyHandle (nh); VerifyHandle (nh);
fhs->set_io_handle (nh); fhs->set_io_handle (nh);
cygheap->fdtab.inc_need_fixup_before ();
return 0; return 0;
} }

View File

@ -1170,7 +1170,7 @@ cygwin_getpeername (int fd, struct sockaddr *name, int *len)
else else
res = fh->getpeername (name, len); res = fh->getpeername (name, len);
syscall_printf ("%d = getpeername %d", res, (fh ? fh->get_socket () : -1)); syscall_printf ("%d = getpeername (%d) %d", res, fd, (fh ? fh->get_socket () : -1));
return res; return res;
} }