Annotation of pkgsrc/lang/python39/patches/patch-Modules_socketmodule.c, revision 1.3

1.3     ! jperkin     1: $NetBSD: patch-Modules_socketmodule.c,v 1.2 2021/05/22 11:36:01 bouyer Exp $
1.1       adam        2: 
                      3: Support NetBSD's socketcan implementation
                      4: 
1.3     ! jperkin     5: --- Modules/socketmodule.c.orig        2022-01-13 21:21:23.000000000 +0000
        !             6: +++ Modules/socketmodule.c
        !             7: @@ -2154,7 +2154,7 @@ getsockaddrarg(PySocketSockObject *s, Py
1.2       bouyer      8:              PyObject *interfaceName;
                      9:              struct ifreq ifr;
                     10:              Py_ssize_t len;
                     11: -            struct sockaddr_can *addr = &addrbuf->can;
                     12: +            struct sockaddr_can *addr = (struct sockaddr_can *)addrbuf;
                     13:  
                     14:              if (!PyTuple_Check(args)) {
                     15:                  PyErr_Format(PyExc_TypeError,
1.3     ! jperkin    16: @@ -5489,7 +5489,7 @@ socket_sethostname(PyObject *self, PyObj
        !            17:      Py_buffer buf;
        !            18:      int res, flag = 0;
        !            19:  
        !            20: -#ifdef _AIX
        !            21: +#if defined(_AIX) || (defined(__sun) && PKGSRC_OPSYS_VERSION < 051100)
        !            22:  /* issue #18259, not declared in any useful header file */
        !            23:  extern int sethostname(const char *, size_t);
        !            24:  #endif
        !            25: @@ -7824,6 +7824,20 @@ PyInit__socket(void)
1.1       adam       26:  
                     27:      PyModule_AddIntMacro(m, J1939_FILTER_MAX);
                     28:  #endif
                     29: +#ifdef HAVE_NETCAN_CAN_H
                     30: +    PyModule_AddIntMacro(m, CAN_EFF_FLAG);
                     31: +    PyModule_AddIntMacro(m, CAN_RTR_FLAG);
                     32: +    PyModule_AddIntMacro(m, CAN_ERR_FLAG);
                     33: +
                     34: +    PyModule_AddIntMacro(m, CAN_SFF_MASK);
                     35: +    PyModule_AddIntMacro(m, CAN_EFF_MASK);
                     36: +    PyModule_AddIntMacro(m, CAN_ERR_MASK);
                     37: +
                     38: +    PyModule_AddIntMacro(m, CAN_RAW_FILTER);
                     39: +    /* PyModule_AddIntMacro(m, CAN_RAW_ERR_FILTER); */
                     40: +    PyModule_AddIntMacro(m, CAN_RAW_LOOPBACK);
                     41: +    PyModule_AddIntMacro(m, CAN_RAW_RECV_OWN_MSGS);
                     42: +#endif
                     43:  #ifdef SOL_RDS
                     44:      PyModule_AddIntMacro(m, SOL_RDS);
                     45:  #endif

CVSweb <webmaster@jp.NetBSD.org>