From: Andrew Tridgell Date: Mon, 1 Nov 1999 21:35:15 +0000 (+0000) Subject: added a replacement inet_aton() for systems that don't have it. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/b17bc22bb3fc0c64092f31a31acbe21947c775ab added a replacement inet_aton() for systems that don't have it. thanks to Dave for pointing this out. --- diff --git a/configure.in b/configure.in index ab2ccc3c..80f46508 100644 --- a/configure.in +++ b/configure.in @@ -53,7 +53,7 @@ AC_FUNC_UTIME_NULL AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod) AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime) AC_CHECK_FUNCS(memmove lchown vsnprintf snprintf setsid glob strpbrk) -AC_CHECK_FUNCS(strlcat strlcpy) +AC_CHECK_FUNCS(strlcat strlcpy inet_aton) AC_CACHE_CHECK([for working fnmatch],rsync_cv_HAVE_FNMATCH,[ AC_TRY_RUN([#include diff --git a/lib/compat.c b/lib/compat.c index 1bf46b9c..8580fdb9 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -145,3 +145,19 @@ return ret; } #endif + +#ifndef HAVE_INET_ATON + int inet_aton(const char *cp, struct in_addr *inp) +{ + if (strcmp(cp, "255.255.255.255") == 0) { + inp->s_addr = (unsigned) -1; + return 1; + } + + inp->s_addr = inet_addr(cp); + if (inp->s_addr == (unsigned) -1) { + return 0; + } + return 1; +} +#endif