diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-03-07 18:54:25 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-03-07 18:55:20 -0800 |
commit | 59c7a5d71145d88933a535e222bdf30105e7d382 (patch) | |
tree | 04724485be6c619e6257873f7d05c2ae51bcbb64 /lib-src/pop.c | |
parent | 6bc8689c042830ae8c13e34af993e8f923e47c9d (diff) |
Assume getaddrinfo in C code
* admin/CPP-DEFINES, configure.ac: Remove HAVE_GETADDRINFO, HAVE_H_ERRNO.
All uses removed.
* doc/lispref/processes.texi (Network, Network Processes), etc/NEWS:
Say that port numbers can be integer strings.
* lib-src/pop.c (h_errno) [!WINDOWSNT && !HAVE_H_ERRNO]: Remove decl.
(socket_connection): Assume HAVE_GETADDRINFO.
* lisp/mpc.el (mpc--proc-connect):
* lisp/net/network-stream.el (open-network-stream):
It’s now OK to use integer strings as port numbers.
* src/process.c (conv_numerical_to_lisp) [!HAVE_GETADDRINFO]: Remove.
(Fmake_network_process): Assume HAVE_GETADDRINFO.
Diffstat (limited to 'lib-src/pop.c')
-rw-r--r-- | lib-src/pop.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib-src/pop.c b/lib-src/pop.c index 21d721546b..983993461b 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c @@ -102,12 +102,6 @@ extern char *krb_realmofhost (/* char * */); #endif /* ! KERBEROS5 */ #endif /* KERBEROS */ -#ifndef WINDOWSNT -#ifndef HAVE_H_ERRNO -extern int h_errno; -#endif -#endif - static int socket_connection (char *, int); static int pop_getline (popserver, char **); static int sendline (popserver, const char *); @@ -972,13 +966,9 @@ static int have_winsock = 0; static int socket_connection (char *host, int flags) { -#ifdef HAVE_GETADDRINFO struct addrinfo *res, *it; struct addrinfo hints; int ret; -#else /* !HAVE_GETADDRINFO */ - struct hostent *hostent; -#endif struct servent *servent; struct sockaddr_in addr; char found_port = 0; @@ -1065,7 +1055,6 @@ socket_connection (char *host, int flags) } -#ifdef HAVE_GETADDRINFO memset (&hints, 0, sizeof (hints)); hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; @@ -1097,34 +1086,6 @@ socket_connection (char *host, int flags) } freeaddrinfo (res); -#else /* !HAVE_GETADDRINFO */ - do - { - hostent = gethostbyname (host); - try_count++; - if ((! hostent) && ((h_errno != TRY_AGAIN) || (try_count == 5))) - { - strcpy (pop_error, "Could not determine POP server's address"); - return (-1); - } - } while (! hostent); - - while (*hostent->h_addr_list) - { - memcpy (&addr.sin_addr, *hostent->h_addr_list, hostent->h_length); - if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) - break; - hostent->h_addr_list++; - } - connect_ok = *hostent->h_addr_list != NULL; - if (! connect_ok) - { - realhost = alloca (strlen (hostent->h_name) + 1); - strcpy (realhost, hostent->h_name); - } - -#endif /* !HAVE_GETADDRINFO */ - #define CONNECT_ERROR "Could not connect to POP server: " if (! connect_ok) |