lib/util: Remove unused sys_gethostbyname()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 9 Feb 2012 01:54:24 +0000 (12:54 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 17 Feb 2012 11:19:29 +0000 (12:19 +0100)
Found by callcatcher.

Andrew Bartlett

lib/util/samba_util.h
lib/util/system.c

index 8e8e7c1abd705af907dac5d7b09bc5e82cd4b5f4..56dbc059d83967348f99d2fb11d76687866dd4d9 100644 (file)
@@ -117,12 +117,6 @@ void CatchChildLeaveStatus(void);
 
 void *sys_memalign( size_t align, size_t size );
 
-/**************************************************************************
-A wrapper for gethostbyname() that tries avoids looking up hostnames 
-in the root domain, which can cause dial-on-demand links to come up for no
-apparent reason.
-****************************************************************************/
-_PUBLIC_ struct hostent *sys_gethostbyname(const char *name);
 _PUBLIC_ struct in_addr sys_inet_makeaddr(int net, int host);
 
 /**
index 1e80f1a88a301828913c724b0485e6f77a93e473..3783e3243c00141e15634db7ea68f84ef21762c1 100644 (file)
@@ -75,48 +75,6 @@ void *sys_memalign( size_t align, size_t size )
 #endif
 }
 
-/**************************************************************************
-A wrapper for gethostbyname() that tries avoids looking up hostnames 
-in the root domain, which can cause dial-on-demand links to come up for no
-apparent reason.
-****************************************************************************/
-
-_PUBLIC_ struct hostent *sys_gethostbyname(const char *name)
-{
-#ifdef REDUCE_ROOT_DNS_LOOKUPS
-       char query[256], hostname[256];
-       char *domain;
-
-       /* Does this name have any dots in it? If so, make no change */
-
-       if (strchr(name, '.'))
-               return(gethostbyname(name));
-
-       /* Get my hostname, which should have domain name 
-               attached. If not, just do the gethostname on the
-               original string. 
-       */
-
-       gethostname(hostname, sizeof(hostname) - 1);
-       hostname[sizeof(hostname) - 1] = 0;
-       if ((domain = strchr(hostname, '.')) == NULL)
-               return(gethostbyname(name));
-
-       /* Attach domain name to query and do modified query.
-               If names too large, just do gethostname on the
-               original string.
-       */
-
-       if((strlen(name) + strlen(domain)) >= sizeof(query))
-               return(gethostbyname(name));
-
-       slprintf(query, sizeof(query)-1, "%s%s", name, domain);
-       return(gethostbyname(query));
-#else /* REDUCE_ROOT_DNS_LOOKUPS */
-       return(gethostbyname(name));
-#endif /* REDUCE_ROOT_DNS_LOOKUPS */
-}
-
 _PUBLIC_ struct in_addr sys_inet_makeaddr(int net, int host)
 {
        struct in_addr in;