Commit ab9f633c authored by Min Si's avatar Min Si Committed by Pavan Balaji
Browse files

Added function check and declaration for hstrerror.

On FreeBSD-10.1, function hstrerror is implemented in libc but its
declaration is disabled in netdb.h by default. Thus error "implicit
declaration of function hstrerrori" was reported when compiling hydra.
This patch adds two steps in hydra configure in order to transparently
fix this issue:
1. Check if function hstrerror exists (in libc).
2. Add the declaration of hstrerror if it exists in libc but the
declaration is disabled.

Signed-off-by: Pavan Balaji's avatarPavan Balaji <>
parent 6de3fab0
......@@ -169,7 +169,11 @@ AC_SEARCH_LIBS(hstrerror, resolv,)
# Check for necessary functions
AC_CHECK_FUNCS(gettimeofday time strdup sigaction signal usleep alloca unsetenv \
strerror strsignal stat fcntl alarm isatty inet_ntop getpgid \
setsid killpg)
setsid killpg hstrerror)
if test "$ac_cv_func_hstrerror" = "yes" ; then
PAC_FUNC_NEEDS_DECL([#include <netdb.h>],hstrerror)
if test "$ac_cv_func_gettimeofday" = "yes" ; then
PAC_FUNC_NEEDS_DECL([#include <sys/time.h>],gettimeofday)
......@@ -157,6 +157,10 @@ extern char *HYD_dbg_prefix;
extern char **environ;
const char * hstrerror(int err);
int gettimeofday(struct timeval *tv, struct timezone *tz);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment