dschanoeh / socketcand

A deprecated fork of socketcand. Please got to linux-can for the latest version.
https://github.com/linux-can/socketcand
131 stars 40 forks source link

fix include to find SIOCGSTAMP with latest kernel #26

Closed ffontaine closed 5 years ago

ffontaine commented 5 years ago

In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115 the asm-generic/sockios.h header no longer defines SIOCGSTAMP. Instead it provides only SIOCGSTAMP_OLD.

The linux/sockios.h header now defines SIOCGSTAMP using either SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. This linux only header file is not pulled so we get a build failure.

./state_bcm.c: In function 'state_bcm': ./state_bcm.c:91:16: error: 'SIOCGSTAMP' undeclared (first use in this function); did you mean 'SIOCGARP'? if(ioctl(sc, SIOCGSTAMP, &tv) < 0) {

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com