hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From f36f71f60b1e68c0f12e615b9b128d089ec3dd19 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 7 Jun 2019 09:51:33 +0200
Subject: tools: Fix build after y2038 changes in glibc
 
The 32-bit SIOCGSTAMP has been deprecated. Use the deprecated name
to fix the build.
[Retrieved (and backported) from:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/tools/?id=f36f71f60b1e68c0f12e615b9b128d089ec3dd19]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 test/l2test.c | 6 +++++-
 test/rctest.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
 
(limited to 'tools')
 
diff --git a/test/l2test.c b/test/l2test.c
index e755ac881..e787c2ce2 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -55,6 +55,10 @@
 #define BREDR_DEFAULT_PSM    0x1011
 #define LE_DEFAULT_PSM        0x0080
 
+#ifndef SIOCGSTAMP_OLD
+#define SIOCGSTAMP_OLD SIOCGSTAMP
+#endif
+
 /* Test modes */
 enum {
     SEND,
@@ -907,7 +911,7 @@ static void recv_mode(int sk)
             if (timestamp) {
                 struct timeval tv;
 
-                if (ioctl(sk, SIOCGSTAMP, &tv) < 0) {
+                if (ioctl(sk, SIOCGSTAMP_OLD, &tv) < 0) {
                     timestamp = 0;
                     memset(ts, 0, sizeof(ts));
                 } else {
diff --git a/test/rctest.c b/test/rctest.c
index 94490f462..bc8ed875d 100644
--- a/test/rctest.c
+++ b/test/rctest.c
@@ -50,6 +50,10 @@
 
 #include "src/shared/util.h"
 
+#ifndef SIOCGSTAMP_OLD
+#define SIOCGSTAMP_OLD SIOCGSTAMP
+#endif
+
 /* Test modes */
 enum {
     SEND,
@@ -505,7 +509,7 @@ static void recv_mode(int sk)
             if (timestamp) {
                 struct timeval tv;
 
-                if (ioctl(sk, SIOCGSTAMP, &tv) < 0) {
+                if (ioctl(sk, SIOCGSTAMP_OLD, &tv) < 0) {
                     timestamp = 0;
                     memset(ts, 0, sizeof(ts));
                 } else {
-- 
cgit 1.2-0.3.lf.el7