diff --git a/src/common.c b/src/common.c index 7347931..b60bce7 100644 --- a/src/common.c +++ b/src/common.c @@ -641,7 +641,7 @@ pthread_mutex_t gethostbyname_mutex; int ghbn_init = 0; #endif - +#ifndef NOSTDRESOLVE #ifdef GETHOSTBYNAME_R struct hostent * my_gethostbyname(char *name, char *buf, struct hostent *hp){ struct hostent *result; @@ -656,6 +656,7 @@ struct hostent * my_gethostbyname(char *name, char *buf, struct hostent *hp){ #endif } #endif +#endif #ifdef NOIPV6 uint32_t getip(unsigned char *name){ @@ -689,6 +690,7 @@ uint32_t getip(unsigned char *name){ if(conf.demanddialprog) system(conf.demanddialprog); return (*tmpresolv)(AF_INET, name, (unsigned char *)&retval)?retval:0; } +#ifndef NOSTDRESOLVE #if !defined(_WIN32) && !defined(GETHOSTBYNAME_R) if(!ghbn_init){ pthread_mutex_init(&gethostbyname_mutex, NULL); @@ -707,6 +709,9 @@ uint32_t getip(unsigned char *name){ #endif #ifdef GETHOSTBYNAME_R #undef gethostbyname +#endif +#else + retval=0; #endif return retval; }