~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to sql/udf_example.c

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
762
762
    return 0;
763
763
  }
764
764
#else
765
 
  VOID(pthread_mutex_lock(&LOCK_hostname));
 
765
  pthread_mutex_lock(&LOCK_hostname);
766
766
  if (!(hostent= gethostbyname((char*) name_buff)))
767
767
  {
768
 
    VOID(pthread_mutex_unlock(&LOCK_hostname));
 
768
    pthread_mutex_unlock(&LOCK_hostname);
769
769
    *null_value= 1;
770
770
    return 0;
771
771
  }
772
 
  VOID(pthread_mutex_unlock(&LOCK_hostname));
 
772
  pthread_mutex_unlock(&LOCK_hostname);
773
773
#endif
774
774
  memcpy_fixed((char*) &in,(char*) *hostent->h_addr_list, sizeof(in.s_addr));
775
775
  *res_length= (ulong) (strmov(result, inet_ntoa(in)) - result);
866
866
    return 0;
867
867
  }
868
868
#else
869
 
  VOID(pthread_mutex_lock(&LOCK_hostname));
 
869
  pthread_mutex_lock(&LOCK_hostname);
870
870
  if (!(hp= gethostbyaddr((char*) &taddr, sizeof(taddr), AF_INET)))
871
871
  {
872
 
    VOID(pthread_mutex_unlock(&LOCK_hostname));
 
872
    pthread_mutex_unlock(&LOCK_hostname);
873
873
    *null_value= 1;
874
874
    return 0;
875
875
  }
876
 
  VOID(pthread_mutex_unlock(&LOCK_hostname));
 
876
  pthread_mutex_unlock(&LOCK_hostname);
877
877
#endif
878
878
  *res_length=(ulong) (strmov(result,hp->h_name) - result);
879
879
  return result;