summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-11-04 18:22:29 (GMT)
committerGuido van Rossum <guido@python.org>1999-11-04 18:22:29 (GMT)
commit1b6e463bd54f6e0236b256fe1b47857b778387a9 (patch)
treebc873022ac6ff742add1714693abc318f8dd951c /Modules
parent29e51844917ec3487e1d1b4a5d0de6a3b8acad6d (diff)
downloadcpython-1b6e463bd54f6e0236b256fe1b47857b778387a9.zip
cpython-1b6e463bd54f6e0236b256fe1b47857b778387a9.tar.gz
cpython-1b6e463bd54f6e0236b256fe1b47857b778387a9.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/socketmodule.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 9dfc5d0..4f63434 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -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,