From: doko@ubuntu.com Date: Mon, 13 Jun 2016 14:33:04 +0000 (+0200) Subject: - Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants X-Git-Tag: v3.6.0a2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fcff437de3fea07eb0decc7ccbb344be33d01d95;p=thirdparty%2FPython%2Fcpython.git - Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants exposed on the API which are not implemented on GNU/Hurd. They would not work at runtime anyway. --- diff --git a/Misc/NEWS b/Misc/NEWS index e22ac6fa3ec1..005954f1900b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -50,6 +50,10 @@ Core and Builtins Library ------- +- Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants + exposed on the API which are not implemented on GNU/Hurd. They would not + work at runtime anyway. + - Issue #25455: Fixed crashes in repr of recursive ElementTree.Element and functools.partial objects. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ecdeab4925cd..7d8249095d08 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -12658,12 +12658,14 @@ all_ins(PyObject *m) #ifdef O_LARGEFILE if (PyModule_AddIntMacro(m, O_LARGEFILE)) return -1; #endif +#ifndef __GNU__ #ifdef O_SHLOCK if (PyModule_AddIntMacro(m, O_SHLOCK)) return -1; #endif #ifdef O_EXLOCK if (PyModule_AddIntMacro(m, O_EXLOCK)) return -1; #endif +#endif #ifdef O_EXEC if (PyModule_AddIntMacro(m, O_EXEC)) return -1; #endif diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index dc57810a0792..6355e4a59a61 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -6529,9 +6529,11 @@ PyInit__socket(void) #ifdef SO_OOBINLINE PyModule_AddIntMacro(m, SO_OOBINLINE); #endif +#ifndef __GNU__ #ifdef SO_REUSEPORT PyModule_AddIntMacro(m, SO_REUSEPORT); #endif +#endif #ifdef SO_SNDBUF PyModule_AddIntMacro(m, SO_SNDBUF); #endif