hc
2023-11-20 2e7bd41e4e8ab3d1efdabd9e263a2f7fe79bff8c
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
From d8056252d0c99bfb2482f0a420dcf9a36019ddf8 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Sat, 13 May 2017 18:58:51 +0200
Subject: [PATCH] test: avoid conflict with encrypt function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
 
With a musl based toolchain:
 
test/l2test.c:110:12: error: ‘encrypt’ redeclared as different kind of symbol
 static int encrypt = 0;
            ^
In file included from test/l2test.c:34:0:
[...]/sysroot/usr/include/unistd.h:145:6: note: previous declaration of ‘encrypt’ was here
 void encrypt(char *, int);
      ^
 
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 test/l2test.c | 8 ++++----
 test/rctest.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
 
diff --git a/test/l2test.c b/test/l2test.c
index f66486d..9ef6faf 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -107,7 +107,7 @@ static char *filename = NULL;
 static int rfcmode = 0;
 static int master = 0;
 static int auth = 0;
-static int encrypt = 0;
+static int _encrypt = 0;
 static int secure = 0;
 static int socktype = SOCK_SEQPACKET;
 static int linger = 0;
@@ -340,7 +340,7 @@ static int do_connect(char *svr)
         opt |= L2CAP_LM_MASTER;
     if (auth)
         opt |= L2CAP_LM_AUTH;
-    if (encrypt)
+    if (_encrypt)
         opt |= L2CAP_LM_ENCRYPT;
     if (secure)
         opt |= L2CAP_LM_SECURE;
@@ -475,7 +475,7 @@ static void do_listen(void (*handler)(int sk))
         opt |= L2CAP_LM_MASTER;
     if (auth)
         opt |= L2CAP_LM_AUTH;
-    if (encrypt)
+    if (_encrypt)
         opt |= L2CAP_LM_ENCRYPT;
     if (secure)
         opt |= L2CAP_LM_SECURE;
@@ -1407,7 +1407,7 @@ int main(int argc, char *argv[])
             break;
 
         case 'E':
-            encrypt = 1;
+            _encrypt = 1;
             break;
 
         case 'S':
diff --git a/test/rctest.c b/test/rctest.c
index 4d7c90a..7ad5a0b 100644
--- a/test/rctest.c
+++ b/test/rctest.c
@@ -79,7 +79,7 @@ static char *filename = NULL;
 
 static int master = 0;
 static int auth = 0;
-static int encrypt = 0;
+static int _encrypt = 0;
 static int secure = 0;
 static int socktype = SOCK_STREAM;
 static int linger = 0;
@@ -200,7 +200,7 @@ static int do_connect(const char *svr)
         opt |= RFCOMM_LM_MASTER;
     if (auth)
         opt |= RFCOMM_LM_AUTH;
-    if (encrypt)
+    if (_encrypt)
         opt |= RFCOMM_LM_ENCRYPT;
     if (secure)
         opt |= RFCOMM_LM_SECURE;
@@ -291,7 +291,7 @@ static void do_listen(void (*handler)(int sk))
         opt |= RFCOMM_LM_MASTER;
     if (auth)
         opt |= RFCOMM_LM_AUTH;
-    if (encrypt)
+    if (_encrypt)
         opt |= RFCOMM_LM_ENCRYPT;
     if (secure)
         opt |= RFCOMM_LM_SECURE;
@@ -701,7 +701,7 @@ int main(int argc, char *argv[])
             break;
 
         case 'E':
-            encrypt = 1;
+            _encrypt = 1;
             break;
 
         case 'S':
-- 
2.9.3