From 36128150d108dca30ceb2c03c655c23086da2e20 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Mon, 5 Jan 2015 18:50:43 -0500 Subject: [PATCH] [io-layer] Remove some deadcode from the sockets code. That function is no longer needed since nothing calls it. This was effective dead code for ages as it would only be used by targets with no ipv6. So, unless you're using Debian Potato, nothing to see here. --- mono/io-layer/socket-wrappers.h | 2 -- mono/io-layer/sockets.c | 39 --------------------------------------- 2 files changed, 41 deletions(-) diff --git a/mono/io-layer/socket-wrappers.h b/mono/io-layer/socket-wrappers.h index b6700f3348d..3ccbe977179 100644 --- a/mono/io-layer/socket-wrappers.h +++ b/mono/io-layer/socket-wrappers.h @@ -35,7 +35,6 @@ #define _wapi_setsockopt setsockopt #define _wapi_shutdown shutdown #define _wapi_socket WSASocket -#define _wapi_gethostbyname gethostbyname #define _wapi_select select /* No need to wrap FD_ZERO because it doesnt involve file @@ -76,7 +75,6 @@ extern int _wapi_setsockopt(guint32 handle, int level, int optname, extern int _wapi_shutdown(guint32 handle, int how); extern guint32 _wapi_socket(int domain, int type, int protocol, void *unused, guint32 unused2, guint32 flags); -extern struct hostent *_wapi_gethostbyname(const char *hostname); #ifdef HAVE_SYS_SELECT_H extern int _wapi_select(int nfds, fd_set *readfds, fd_set *writefds, diff --git a/mono/io-layer/sockets.c b/mono/io-layer/sockets.c index 6f8fdd50c4b..52006f1721f 100644 --- a/mono/io-layer/sockets.c +++ b/mono/io-layer/sockets.c @@ -980,45 +980,6 @@ guint32 _wapi_socket(int domain, int type, int protocol, void *unused, return(fd); } -struct hostent *_wapi_gethostbyname(const char *hostname) -{ - struct hostent *he; - - if (startup_count == 0) { - WSASetLastError (WSANOTINITIALISED); - return(NULL); - } - - he = gethostbyname (hostname); - if (he == NULL) { - DEBUG ("%s: gethostbyname error: %s", __func__, - strerror (h_errno)); - - switch(h_errno) { - case HOST_NOT_FOUND: - WSASetLastError (WSAHOST_NOT_FOUND); - break; -#if NO_ADDRESS != NO_DATA - case NO_ADDRESS: -#endif - case NO_DATA: - WSASetLastError (WSANO_DATA); - break; - case NO_RECOVERY: - WSASetLastError (WSANO_RECOVERY); - break; - case TRY_AGAIN: - WSASetLastError (WSATRY_AGAIN); - break; - default: - g_warning ("%s: Need to translate %d into winsock error", __func__, h_errno); - break; - } - } - - return(he); -} - static gboolean socket_disconnect (guint32 fd) { struct _WapiHandle_socket *socket_handle; -- 2.11.4.GIT