]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #27702: Only expose SOCK_RAW when defined
authorBerker Peksag <berker.peksag@gmail.com>
Mon, 8 Aug 2016 11:07:05 +0000 (14:07 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Mon, 8 Aug 2016 11:07:05 +0000 (14:07 +0300)
SOCK_RAW is marked as optional in the POSIX specification:

    http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html

Patch by Ed Schouten.

Modules/socketmodule.c

index d21d18f7e3dec74394edde189f276ebed6faaebd..d21509e9ebe5e62d758c36fee9f57677e3b9addd 100644 (file)
@@ -6495,7 +6495,10 @@ PyInit__socket(void)
     PyModule_AddIntMacro(m, SOCK_STREAM);
     PyModule_AddIntMacro(m, SOCK_DGRAM);
 /* We have incomplete socket support. */
+#ifdef SOCK_RAW
+    /* SOCK_RAW is marked as optional in the POSIX specification */
     PyModule_AddIntMacro(m, SOCK_RAW);
+#endif
     PyModule_AddIntMacro(m, SOCK_SEQPACKET);
 #if defined(SOCK_RDM)
     PyModule_AddIntMacro(m, SOCK_RDM);