diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-08-08 11:07:05 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-08-08 11:07:05 (GMT) |
commit | 95e0df8389c8a44c0f6c6b6be8363e602e8e8914 (patch) | |
tree | a97549e69b94257aabfaf5cf8614ddef29bac465 /Modules/socketmodule.c | |
parent | e1d22fda7ee087ec4ca3fe20f38cbceae83afd28 (diff) | |
download | cpython-95e0df8389c8a44c0f6c6b6be8363e602e8e8914.zip cpython-95e0df8389c8a44c0f6c6b6be8363e602e8e8914.tar.gz cpython-95e0df8389c8a44c0f6c6b6be8363e602e8e8914.tar.bz2 |
Issue #27702: Only expose SOCK_RAW when defined
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.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index d21d18f..d21509e 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -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); |