[Python-checkins] r45419 - in python/trunk: Misc/NEWS Modules/socketmodule.c

martin.v.loewis python-checkins at python.org
Sat Apr 15 10:36:00 CEST 2006


Author: martin.v.loewis
Date: Sat Apr 15 10:35:59 2006
New Revision: 45419

Modified:
   python/trunk/Misc/NEWS
   python/trunk/Modules/socketmodule.c
Log:
Patch #1191065: Fix preprocessor problems on systems where recvfrom
is a macro.


Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Sat Apr 15 10:35:59 2006
@@ -48,6 +48,9 @@
 Extension Modules
 -----------------
 
+- Patch #1191065: Fix preprocessor problems on systems where recvfrom
+  is a macro.
+
 - Bug #1467952: os.listdir() now correctly raises an error if readdir()
   fails with an error condition.
 

Modified: python/trunk/Modules/socketmodule.c
==============================================================================
--- python/trunk/Modules/socketmodule.c	(original)
+++ python/trunk/Modules/socketmodule.c	Sat Apr 15 10:35:59 2006
@@ -2208,18 +2208,20 @@
 	Py_BEGIN_ALLOW_THREADS
 	memset(&addrbuf, 0, addrlen);
 	timeout = internal_select(s, 0);
-	if (!timeout)
-		n = recvfrom(s->sock_fd, PyString_AS_STRING(buf), len, flags,
+	if (!timeout) {
 #ifndef MS_WINDOWS
 #if defined(PYOS_OS2) && !defined(PYCC_GCC)
-			     (struct sockaddr *) &addrbuf, &addrlen
+		n = recvfrom(s->sock_fd, PyString_AS_STRING(buf), len, flags,
+			     (struct sockaddr *) &addrbuf, &addrlen);
 #else
-			     (void *) &addrbuf, &addrlen
+		n = recvfrom(s->sock_fd, PyString_AS_STRING(buf), len, flags,
+			     (void *) &addrbuf, &addrlen);
 #endif
 #else
-			     (struct sockaddr *) &addrbuf, &addrlen
+		n = recvfrom(s->sock_fd, PyString_AS_STRING(buf), len, flags,
+			     (struct sockaddr *) &addrbuf, &addrlen);
 #endif
-			);
+	}
 	Py_END_ALLOW_THREADS
 
 	if (timeout) {


More information about the Python-checkins mailing list