2
1

0005-test-avoid-conflict-with-encrypt-function.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. From d8056252d0c99bfb2482f0a420dcf9a36019ddf8 Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@gmail.com>
  3. Date: Sat, 13 May 2017 18:58:51 +0200
  4. Subject: [PATCH] test: avoid conflict with encrypt function
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. With a musl based toolchain:
  9. test/l2test.c:110:12: error: ‘encrypt’ redeclared as different kind of symbol
  10. static int encrypt = 0;
  11. ^
  12. In file included from test/l2test.c:34:0:
  13. [...]/sysroot/usr/include/unistd.h:145:6: note: previous declaration of ‘encrypt’ was here
  14. void encrypt(char *, int);
  15. ^
  16. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  17. ---
  18. test/l2test.c | 8 ++++----
  19. test/rctest.c | 8 ++++----
  20. 2 files changed, 8 insertions(+), 8 deletions(-)
  21. diff --git a/test/l2test.c b/test/l2test.c
  22. index f66486d..9ef6faf 100644
  23. --- a/test/l2test.c
  24. +++ b/test/l2test.c
  25. @@ -107,7 +107,7 @@ static char *filename = NULL;
  26. static int rfcmode = 0;
  27. static int master = 0;
  28. static int auth = 0;
  29. -static int encrypt = 0;
  30. +static int _encrypt = 0;
  31. static int secure = 0;
  32. static int socktype = SOCK_SEQPACKET;
  33. static int linger = 0;
  34. @@ -340,7 +340,7 @@ static int do_connect(char *svr)
  35. opt |= L2CAP_LM_MASTER;
  36. if (auth)
  37. opt |= L2CAP_LM_AUTH;
  38. - if (encrypt)
  39. + if (_encrypt)
  40. opt |= L2CAP_LM_ENCRYPT;
  41. if (secure)
  42. opt |= L2CAP_LM_SECURE;
  43. @@ -475,7 +475,7 @@ static void do_listen(void (*handler)(int sk))
  44. opt |= L2CAP_LM_MASTER;
  45. if (auth)
  46. opt |= L2CAP_LM_AUTH;
  47. - if (encrypt)
  48. + if (_encrypt)
  49. opt |= L2CAP_LM_ENCRYPT;
  50. if (secure)
  51. opt |= L2CAP_LM_SECURE;
  52. @@ -1407,7 +1407,7 @@ int main(int argc, char *argv[])
  53. break;
  54. case 'E':
  55. - encrypt = 1;
  56. + _encrypt = 1;
  57. break;
  58. case 'S':
  59. diff --git a/test/rctest.c b/test/rctest.c
  60. index 4d7c90a..7ad5a0b 100644
  61. --- a/test/rctest.c
  62. +++ b/test/rctest.c
  63. @@ -79,7 +79,7 @@ static char *filename = NULL;
  64. static int master = 0;
  65. static int auth = 0;
  66. -static int encrypt = 0;
  67. +static int _encrypt = 0;
  68. static int secure = 0;
  69. static int socktype = SOCK_STREAM;
  70. static int linger = 0;
  71. @@ -200,7 +200,7 @@ static int do_connect(const char *svr)
  72. opt |= RFCOMM_LM_MASTER;
  73. if (auth)
  74. opt |= RFCOMM_LM_AUTH;
  75. - if (encrypt)
  76. + if (_encrypt)
  77. opt |= RFCOMM_LM_ENCRYPT;
  78. if (secure)
  79. opt |= RFCOMM_LM_SECURE;
  80. @@ -291,7 +291,7 @@ static void do_listen(void (*handler)(int sk))
  81. opt |= RFCOMM_LM_MASTER;
  82. if (auth)
  83. opt |= RFCOMM_LM_AUTH;
  84. - if (encrypt)
  85. + if (_encrypt)
  86. opt |= RFCOMM_LM_ENCRYPT;
  87. if (secure)
  88. opt |= RFCOMM_LM_SECURE;
  89. @@ -701,7 +701,7 @@ int main(int argc, char *argv[])
  90. break;
  91. case 'E':
  92. - encrypt = 1;
  93. + _encrypt = 1;
  94. break;
  95. case 'S':
  96. --
  97. 2.9.3