blob: cbf3aee10f4e5ebbb14d309c5c0d3a71715d1a1b [file] [log] [blame]
Brad Bishop0f291cc2019-09-01 15:16:57 -04001From 20981c8a328747f823b7eef68d0c2812b3eaed30 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Sun, 14 Jul 2019 21:50:43 +0200
4Subject: [PATCH] fix include to find SIOCGSTAMP with latest kernel
5
6In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115
7the asm-generic/sockios.h header no longer defines SIOCGSTAMP.
8Instead it provides only SIOCGSTAMP_OLD.
9
10The linux/sockios.h header now defines SIOCGSTAMP using either
11SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. This linux only
12header file is not pulled so we get a build failure.
13
14canlogserver.c: In function 'main':
15canlogserver.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
19canlogserver.c:404:21: note: each undeclared identifier is reported only once for each function it appears in
20
21Fixes:
22 - http://autobuild.buildroot.org/results/363de7d9bf433be8bc47ba4ee52ae0bb80fa9021
23
24Upstream-Status: Backport [https://github.com/linux-can/can-utils/commit/e9590b1ca75d360eaf3211bebd86058214d48064]
25Signed-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
35diff --git a/canlogserver.c b/canlogserver.c
36index 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
47diff --git a/cansniffer.c b/cansniffer.c
48index 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
59diff --git a/isotpdump.c b/isotpdump.c
60index 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
71diff --git a/isotpperf.c b/isotpperf.c
72index 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 */
83diff --git a/isotpsniffer.c b/isotpsniffer.c
84index 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
95diff --git a/slcanpty.c b/slcanpty.c
96index 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)