Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 1 | From 20981c8a328747f823b7eef68d0c2812b3eaed30 Mon Sep 17 00:00:00 2001 |
| 2 | From: Fabrice Fontaine <fontaine.fabrice@gmail.com> |
| 3 | Date: Sun, 14 Jul 2019 21:50:43 +0200 |
| 4 | Subject: [PATCH] fix include to find SIOCGSTAMP with latest kernel |
| 5 | |
| 6 | In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115 |
| 7 | the asm-generic/sockios.h header no longer defines SIOCGSTAMP. |
| 8 | Instead it provides only SIOCGSTAMP_OLD. |
| 9 | |
| 10 | The linux/sockios.h header now defines SIOCGSTAMP using either |
| 11 | SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. This linux only |
| 12 | header file is not pulled so we get a build failure. |
| 13 | |
| 14 | canlogserver.c: In function 'main': |
| 15 | canlogserver.c:404:21: error: 'SIOCGSTAMP' undeclared (first use in this function); did you mean 'SIOCGRARP'? |
| 16 | if (ioctl(s[i], SIOCGSTAMP, &tv) < 0) |
| 17 | ^~~~~~~~~~ |
| 18 | SIOCGRARP |
| 19 | canlogserver.c:404:21: note: each undeclared identifier is reported only once for each function it appears in |
| 20 | |
| 21 | Fixes: |
| 22 | - http://autobuild.buildroot.org/results/363de7d9bf433be8bc47ba4ee52ae0bb80fa9021 |
| 23 | |
| 24 | Upstream-Status: Backport [https://github.com/linux-can/can-utils/commit/e9590b1ca75d360eaf3211bebd86058214d48064] |
| 25 | Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> |
| 26 | --- |
| 27 | canlogserver.c | 1 + |
| 28 | cansniffer.c | 1 + |
| 29 | isotpdump.c | 1 + |
| 30 | isotpperf.c | 1 + |
| 31 | isotpsniffer.c | 1 + |
| 32 | slcanpty.c | 1 + |
| 33 | 6 files changed, 6 insertions(+) |
| 34 | |
| 35 | diff --git a/canlogserver.c b/canlogserver.c |
| 36 | index e3350b7..f53165c 100644 |
| 37 | --- a/canlogserver.c |
| 38 | +++ b/canlogserver.c |
| 39 | @@ -61,6 +61,7 @@ |
| 40 | |
| 41 | #include <linux/can.h> |
| 42 | #include <linux/can/raw.h> |
| 43 | +#include <linux/sockios.h> |
| 44 | #include <signal.h> |
| 45 | #include <errno.h> |
| 46 | |
| 47 | diff --git a/cansniffer.c b/cansniffer.c |
| 48 | index 7b0a3fa..bf7d72e 100644 |
| 49 | --- a/cansniffer.c |
| 50 | +++ b/cansniffer.c |
| 51 | @@ -61,6 +61,7 @@ |
| 52 | |
| 53 | #include <linux/can.h> |
| 54 | #include <linux/can/bcm.h> |
| 55 | +#include <linux/sockios.h> |
| 56 | |
| 57 | #include "terminal.h" |
| 58 | |
| 59 | diff --git a/isotpdump.c b/isotpdump.c |
| 60 | index b2b650a..36d8af3 100644 |
| 61 | --- a/isotpdump.c |
| 62 | +++ b/isotpdump.c |
| 63 | @@ -55,6 +55,7 @@ |
| 64 | |
| 65 | #include <linux/can.h> |
| 66 | #include <linux/can/raw.h> |
| 67 | +#include <linux/sockios.h> |
| 68 | #include "terminal.h" |
| 69 | |
| 70 | #define NO_CAN_ID 0xFFFFFFFFU |
| 71 | diff --git a/isotpperf.c b/isotpperf.c |
| 72 | index db3a2b7..5852a57 100644 |
| 73 | --- a/isotpperf.c |
| 74 | +++ b/isotpperf.c |
| 75 | @@ -56,6 +56,7 @@ |
| 76 | |
| 77 | #include <linux/can.h> |
| 78 | #include <linux/can/raw.h> |
| 79 | +#include <linux/sockios.h> |
| 80 | |
| 81 | #define NO_CAN_ID 0xFFFFFFFFU |
| 82 | #define PERCENTRES 2 /* resolution in percent for bargraph */ |
| 83 | diff --git a/isotpsniffer.c b/isotpsniffer.c |
| 84 | index f42e18b..d7a4c66 100644 |
| 85 | --- a/isotpsniffer.c |
| 86 | +++ b/isotpsniffer.c |
| 87 | @@ -55,6 +55,7 @@ |
| 88 | |
| 89 | #include <linux/can.h> |
| 90 | #include <linux/can/isotp.h> |
| 91 | +#include <linux/sockios.h> |
| 92 | #include "terminal.h" |
| 93 | |
| 94 | #define NO_CAN_ID 0xFFFFFFFFU |
| 95 | diff --git a/slcanpty.c b/slcanpty.c |
| 96 | index 431ca68..7dfaf5c 100644 |
| 97 | --- a/slcanpty.c |
| 98 | +++ b/slcanpty.c |
| 99 | @@ -40,6 +40,7 @@ |
| 100 | |
| 101 | #include <linux/can.h> |
| 102 | #include <linux/can/raw.h> |
| 103 | +#include <linux/sockios.h> |
| 104 | |
| 105 | /* maximum rx buffer len: extended CAN frame with timestamp */ |
| 106 | #define SLC_MTU (sizeof("T1111222281122334455667788EA5F\r")+1) |