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 <balaji@anl.gov>
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)
fi
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;
#endif /* MANUAL_EXTERN_ENVIRON */
#if defined NEEDS_HSTRERROR_DECL
const char * hstrerror(int err);
#endif /* NEEDS_HSTRERROR_DECL */
#if defined NEEDS_GETTIMEOFDAY_DECL
int gettimeofday(struct timeval *tv, struct timezone *tz);
#endif /* NEEDS_GETTIMEOFDAY_DECL */
......
Markdown is supported
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