diff Modules/socketmodule.c @ 31898:64fcff121f7b 2.3

Backport to 2.3: Fixes for AF_UNIX support on OS/2: - return the full size of the sockaddr_un structure, without which bind() fails with EINVAL; - set test_socketserver to use a socket name that meets the form required by the underlying implementation; - don't bother exercising the forking AF_UNIX tests on EMX - its fork() can't handle the stress.
author Andrew MacIntyre <andymac@bullseye.apana.org.au>
date Sun, 11 Apr 2004 12:12:31 +0000
parents 5a36e4d5aa8f
children f159b15f1f5c
line wrap: on
line diff
--- a/Modules/socketmodule.c	Thu Apr 08 19:45:36 2004 +0000
+++ b/Modules/socketmodule.c	Sun Apr 11 12:12:31 2004 +0000
@@ -950,7 +950,11 @@
 		memcpy(addr->sun_path, path, len);
 		addr->sun_path[len] = 0;
 		*addr_ret = (struct sockaddr *) addr;
+#if defined(PYOS_OS2)
+		*len_ret = sizeof(*addr);
+#else
 		*len_ret = len + sizeof(*addr) - sizeof(addr->sun_path);
+#endif
 		return 1;
 	}
 #endif /* AF_UNIX */