summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 3b5f3adf88a..c8cf46383a9 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -14,9 +14,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/*
- Get hostname for an IP. Hostnames are checked with reverse name lookup and
- checked that they doesn't resemble an ip.
+/**
+ @file
+
+ @brief
+ Get hostname for an IP.
+
+ Hostnames are checked with reverse name lookup and
+ checked that they doesn't resemble an ip.
*/
#include "mysql_priv.h"
@@ -25,7 +30,7 @@
#ifdef __cplusplus
extern "C" { // Because of SCO 3.2V4.2
#endif
-#if !defined( __WIN__) && !defined(OS2)
+#if !defined( __WIN__)
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
@@ -84,7 +89,7 @@ static void add_hostname(struct in_addr *in,const char *name)
{
VOID(pthread_mutex_lock(&hostname_cache->lock));
host_entry *entry;
- if (!(entry=(host_entry*) hostname_cache->search((gptr) &in->s_addr,0)))
+ if (!(entry=(host_entry*) hostname_cache->search((uchar*) &in->s_addr,0)))
{
uint length=name ? (uint) strlen(name) : 0;
@@ -115,7 +120,7 @@ void inc_host_errors(struct in_addr *in)
{
VOID(pthread_mutex_lock(&hostname_cache->lock));
host_entry *entry;
- if ((entry=(host_entry*) hostname_cache->search((gptr) &in->s_addr,0)))
+ if ((entry=(host_entry*) hostname_cache->search((uchar*) &in->s_addr,0)))
entry->errors++;
VOID(pthread_mutex_unlock(&hostname_cache->lock));
}
@@ -124,7 +129,7 @@ void reset_host_errors(struct in_addr *in)
{
VOID(pthread_mutex_lock(&hostname_cache->lock));
host_entry *entry;
- if ((entry=(host_entry*) hostname_cache->search((gptr) &in->s_addr,0)))
+ if ((entry=(host_entry*) hostname_cache->search((uchar*) &in->s_addr,0)))
entry->errors=0;
VOID(pthread_mutex_unlock(&hostname_cache->lock));
}
@@ -134,7 +139,7 @@ void reset_host_errors(struct in_addr *in)
#define INADDR_LOOPBACK 0x7f000001UL
#endif
-my_string ip_to_hostname(struct in_addr *in, uint *errors)
+char * ip_to_hostname(struct in_addr *in, uint *errors)
{
uint i;
host_entry *entry;
@@ -149,7 +154,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors)
if (!(specialflag & SPECIAL_NO_HOST_CACHE))
{
VOID(pthread_mutex_lock(&hostname_cache->lock));
- if ((entry=(host_entry*) hostname_cache->search((gptr) &in->s_addr,0)))
+ if ((entry=(host_entry*) hostname_cache->search((uchar*) &in->s_addr,0)))
{
char *name;
if (!entry->hostname)