Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
96e53649
Commit
96e53649
authored
Jan 11, 1999
by
Niels Möller
Browse files
* io.c (get_inaddr): Check HAVE_INET_ATON.
Rev: src/configure.in:1.26 Rev: src/io.c:1.43
parent
50228a4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/configure.in
View file @
96e53649
...
...
@@ -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,
...
...
src/io.c
View file @
96e53649
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment