Bugfix by Jack Jansen for Macintosh (for the inet_ntoa/aton changes):

<arpa/inet.h> doesn't exist and isn't needed; and inet_addr() returns
a structure containing a long rather than a long.
This commit is contained in:
Guido van Rossum 1999-11-04 18:22:29 +00:00
parent 29e5184491
commit 1b6e463bd5
1 changed files with 6 additions and 1 deletions

View File

@ -165,8 +165,10 @@ int shutdown( int, int );
#ifdef __BEOS__
#include <net/netdb.h>
#else
#ifndef macintosh
#include <arpa/inet.h>
#endif
#endif
#include <fcntl.h>
#else
@ -1829,8 +1831,11 @@ BUILD_FUNC_DEF_2(PySocket_inet_aton, PyObject *, self, PyObject *, args)
if (!PyArg_Parse(args, "s", &ip_addr)) {
return NULL;
}
#ifdef macintosh
packed_addr = (long)inet_addr(ip_addr).s_addr;
#else
packed_addr = inet_addr(ip_addr);
#endif
if (packed_addr == INADDR_NONE) { /* invalid address */
PyErr_SetString(PySocket_Error,