Commit 96e53649 authored by Niels Möller's avatar Niels Möller

* io.c (get_inaddr): Check HAVE_INET_ATON.

Rev: src/configure.in:1.26
Rev: src/io.c:1.43
parent 50228a4f
......@@ -164,15 +164,15 @@ AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(select socket strerror strtol)
AC_CHECK_FUNCS(getspnam)
AC_CHECK_FUNCS(vsnprintf)
AC_CHECK_FUNCS(vsnprintf inet_aton)
AC_CHECK_FUNCS(poll,,[LIBOBJS = jpoll.c $LIBOBJS])
AC_CHECK_FUNCS(poll,,[LIBOBJS = jpoll.o $LIBOBJS])
dnl This macro is mentioned in the automake manual, but where is it
dnl supposed to be defined?
dnl AC_REPLACE_GNU_GETOPT
AC_CHECK_FUNCS(getopt_long,,[LIBOBJS = getopt.c getopt1.c $LIBOBJS])
AC_CHECK_FUNCS(getopt_long,,[LIBOBJS = getopt.o getopt1.o $LIBOBJS])
dnl Check for broken shutdown
AC_CACHE_CHECK(for working shutdown on AF_UNIX sockets,
......
......@@ -503,21 +503,20 @@ get_inaddr(struct sockaddr_in * addr,
else
{
/* First check for numerical ip-number */
#if 1
/* FIXME: How portable is inet_aton? */
#if HAVE_INET_ATON
if (!inet_aton(host, &addr->sin_addr))
#else
#else /* !HAVE_INET_ATON */
/* TODO: It is wrong to work with ((unsigned long int) -1)
* directly, as this breaks Linux/Alpha systems. But
* INADDR_NONE isn't portable. The clean solution is to use
* inet_aton rather than inet_addr; see the GNU libc
* documentation. */
#ifndef INADDR_NONE
#define INADDR_NONE ((unsigned long int) -1)
#endif
# ifndef INADDR_NONE
# define INADDR_NONE ((unsigned long int) -1)
# endif /* !INADDR_NONE */
addr->sin_addr.s_addr = inet_addr(host);
if (addr->sin_addr.s_addr == INADDR_NONE)
#endif
#endif /* !HAVE_INET_ATON */
{
struct hostent * hp;
......
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