summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 5359f876522..bd4ec06c083 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -57,8 +57,11 @@ void hostname_cache_refresh()
bool hostname_cache_init()
{
+ host_entry *tmp;
+ uint offset= (uint) ((char*) (&tmp->ip) - (char*) &tmp);
(void) pthread_mutex_init(&LOCK_hostname,MY_MUTEX_INIT_SLOW);
- if (!(hostname_cache=new hash_filo(HOST_CACHE_SIZE,offsetof(host_entry,ip),
+
+ if (!(hostname_cache=new hash_filo(HOST_CACHE_SIZE, offset,
sizeof(struct in_addr),NULL,
(void (*)(void*)) free)))
return 1;