From 82b30180882f3f81298bfd45f3753dfc536ddcff Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 19 Aug 2004 10:58:37 +0000 Subject: [PATCH] * 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. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler_socket.cc | 6 +++++- winsup/cygwin/net.cc | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 573b3528c..88dd664f5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2004-08-19 Corinna Vinschen + + * 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 * fhandler.h (fhandler_dev_dsp:~fhandler_dev_dsp): Delete. diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 5b7b97da9..b8ec37bdc 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -344,7 +344,10 @@ fhandler_socket::dup (fhandler_base *child) { fhs->fixup_after_fork (hMainProc); if (fhs->get_io_handle() != (HANDLE) INVALID_SOCKET) - return 0; + { + cygheap->fdtab.inc_need_fixup_before (); + return 0; + } } debug_printf ("WSADuplicateSocket failed, trying DuplicateHandle"); } @@ -363,6 +366,7 @@ fhandler_socket::dup (fhandler_base *child) } VerifyHandle (nh); fhs->set_io_handle (nh); + cygheap->fdtab.inc_need_fixup_before (); return 0; } diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index ce1bf60e6..baa96bb2d 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -1170,7 +1170,7 @@ cygwin_getpeername (int fd, struct sockaddr *name, int *len) else 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; }