[issue10141] SocketCan support

Charles-François Natali report at bugs.python.org
Fri Oct 7 13:48:42 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

>From python-dev:
"""
I work on Ubuntu Jaunty for my cpython development work - an old version, I
know, but still quite serviceable and has worked well for me over many months.
With the latest default cpython repository, however, I can't run the regression
suite because the socket module now fails to build:

gcc -pthread -fPIC -g -O0 -Wall -Wstrict-prototypes -IInclude -I.
  -I./Include -I/usr/local/include -I/home/vinay/projects/python/default -c
  /home/vinay/projects/python/default/Modules/socketmodule.c
  -o build/temp.linux-i686-3.3-pydebug/home/vinay/projects/python/default
  /Modules/socketmodule.o
.../Modules/socketmodule.c: In function
‘makesockaddr’:
.../Modules/socketmodule.c:1224: error: ‘AF_CAN’ undeclared (first use in
this function)
.../Modules/socketmodule.c:1224: error: (Each undeclared identifier is
reported only once
.../Modules/socketmodule.c:1224: error: for each function it appears in.)
.../Modules/socketmodule.c: In function
‘getsockaddrarg’:
.../Modules/socketmodule.c:1610: error: ‘AF_CAN’ undeclared (first use in
this function)
.../Modules/socketmodule.c: In function ‘getsockaddrlen’:
.../Modules/socketmodule.c:1750: error: ‘AF_CAN’ undeclared (first use in
this function)

On this system, AF_CAN *is* defined, but in linux/socket.h, not in sys/socket.h.
>From what I can see, sys/socket.h includes bits/socket.h which includes
asm/socket.h, but apparently linux/socket.h isn't included.
"""

Vinay, what happens if you replace in Modules/socketmodule.h:
"""
#ifdef HAVE_LINUX_CAN_H
#include <linux/can.h>
#endif
"""

with

"""
#ifdef HAVE_LINUX_CAN_H
#include <linux/socket.h>
#include <linux/can.h>
#endif
"""

----------
nosy: +vinay.sajip
resolution: fixed -> 
stage: committed/rejected -> needs patch
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10141>
_______________________________________


More information about the Python-bugs-list mailing list