--- src/net_udp.c 2006-09-13 13:36:10.000000000 -0400 +++ src/net_udp.c 2011-03-13 20:21:40.000000000 -0400 @@ -44,7 +44,4 @@ #include "debug.h" #include "memory.h" -#include "inet_pton.h" -#include "inet_ntop.h" -#include "vsnprintf.h" #include "net_udp.h" @@ -126,4 +123,11 @@ /*****************************************************************************/ +#if defined(BSD) || defined(LINUX) +# include +# define socket_error warn +#else /* { */ +# ifdef __FreeBSD__ /* A simple check */ +# error On FreeBSD BSD should be defined +# endif static void socket_error(const char *msg, ...) @@ -166,4 +170,5 @@ #endif } +#endif /* } not a BSD system */ #ifdef WIN32 @@ -251,5 +256,5 @@ return TRUE; } - socket_error("Can't resolve IP address for %s", dst); + herror(dst); return FALSE; @@ -273,5 +278,5 @@ struct hostent *h = gethostbyname(addr); if (h == NULL) { - socket_error("Can't resolve IP address for %s", addr); + herror(addr); free(s); return NULL; @@ -422,5 +427,5 @@ hent = gethostbyname(hname); if (hent == NULL) { - socket_error("Can't resolve IP address for %s", hname); + herror(hname); return NULL; }