Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-04-02 15:30:27 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-04-02 15:30:27 +0400
commitbb8216a1140d53534247949ee29c48bc158f3d13 (patch)
treed8038b0998778b580244f51e9cd863a2e955b125 /winsup/cygwin/fhandler_socket.cc
parente9b55002ba0831f71ccd76955b94ce4e1a61a682 (diff)
* autoload.cc (GetExtendedTcpTable): Remove.
(GetTcpTable): Remove. (CharNextExA): Remove. (FindWindowA): Remove. (ShowWindowAsync): Remove. * dcrt0.cc (disable_dep): Remove unused function. (dll_crt0_0): Drop comment babbling about TS & DEP. * fhandler_socket.cc (address_in_use): Remove unused function. * wincap.cc: Throughout, drop ts_has_dep_problem from wincaps. (wincapc::init): Drop code setting ts_has_dep_problem flag. * wincap.h (struct wincaps): Drop ts_has_dep_problem flags and method.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc68
1 files changed, 0 insertions, 68 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index b5eab051d..0a7c5ddf4 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -872,74 +872,6 @@ fhandler_socket::link (const char *newpath)
return fhandler_base::link (newpath);
}
-#if 0
-/* This function doesn't work correctly. It has been called in bind to check
- if a local address is still in use, but it disables to bind in the
- SO_REUSEADDR case even if only an accepted socket is still using the
- local address, and even if said accepted socket is already in CLOSE_WAIT.
- I keep this function in the code for later reference only. */
-static inline bool
-address_in_use (const struct sockaddr *addr)
-{
- switch (addr->sa_family)
- {
- case AF_INET:
- {
- PMIB_TCPTABLE tab;
- PMIB_TCPROW entry;
- DWORD size = 0, i;
- struct sockaddr_in *in = (struct sockaddr_in *) addr;
-
- if (GetTcpTable (NULL, &size, FALSE) == ERROR_INSUFFICIENT_BUFFER)
- {
- tab = (PMIB_TCPTABLE) alloca (size += 16 * sizeof (PMIB_TCPROW));
- if (!GetTcpTable (tab, &size, FALSE))
- for (i = tab->dwNumEntries, entry = tab->table; i > 0;
- --i, ++entry)
- if (entry->dwLocalAddr == in->sin_addr.s_addr
- && entry->dwLocalPort == in->sin_port
- && entry->dwState >= MIB_TCP_STATE_LISTEN
- && entry->dwState <= MIB_TCP_STATE_LAST_ACK)
- return true;
- }
- }
- break;
- case AF_INET6:
- {
- /* This test works on XP SP2 and above which should cover almost
- all IPv6 users... */
- PMIB_TCP6TABLE_OWNER_PID tab;
- PMIB_TCP6ROW_OWNER_PID entry;
- DWORD size = 0, i;
- struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) addr;
-
- if (GetExtendedTcpTable (NULL, &size, FALSE, AF_INET6,
- TCP_TABLE_OWNER_PID_ALL, 0)
- == ERROR_INSUFFICIENT_BUFFER)
- {
- tab = (PMIB_TCP6TABLE_OWNER_PID)
- alloca (size += 16 * sizeof (PMIB_TCP6ROW_OWNER_PID));
- if (!GetExtendedTcpTable (tab, &size, FALSE, AF_INET6,
- TCP_TABLE_OWNER_PID_ALL, 0))
- for (i = tab->dwNumEntries, entry = tab->table; i > 0;
- --i, ++entry)
- if (IN6_ARE_ADDR_EQUAL (entry->ucLocalAddr,
- in6->sin6_addr.s6_addr)
- /* FIXME: Is testing for the scope required. too?!? */
- && entry->dwLocalPort == in6->sin6_port
- && entry->dwState >= MIB_TCP_STATE_LISTEN
- && entry->dwState <= MIB_TCP_STATE_LAST_ACK)
- return true;
- }
- }
- break;
- default:
- break;
- }
- return false;
-}
-#endif
-
int
fhandler_socket::bind (const struct sockaddr *name, int namelen)
{