]> code.ossystems Code Review - openembedded-core.git/commitdiff
bluez4: Fix encrypt symbol namespace collision
authorKhem Raj <raj.khem@gmail.com>
Mon, 6 Apr 2015 17:36:45 +0000 (17:36 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 May 2015 17:12:03 +0000 (18:12 +0100)
| Makefile:3352: recipe for target 'test/l2test.o' failed
| make[1]: *** [test/l2test.o] Error 1
| make[1]: *** Waiting for unfinished jobs....
| test/rctest.c:82:12: error: 'encrypt' redeclared as different kind of
symbol
|  static int encrypt = 0;
|             ^
| In file included from test/rctest.c:33:0:

Change-Id: Iaf2f644ef3cef6f96c6e4bc421c9e78a0e23e674
(From OE-Core master rev: 795a409919774f3a2a4c859799de36f1064efd83)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/bluez/bluez4-4.101/fix_encrypt_collision.patch [new file with mode: 0644]
meta/recipes-connectivity/bluez/bluez4_4.101.bb

diff --git a/meta/recipes-connectivity/bluez/bluez4-4.101/fix_encrypt_collision.patch b/meta/recipes-connectivity/bluez/bluez4-4.101/fix_encrypt_collision.patch
new file mode 100644 (file)
index 0000000..1bc390f
--- /dev/null
@@ -0,0 +1,110 @@
+Avoid namepspace collision with encrypt function from libc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: bluez-4.101/test/l2test.c
+===================================================================
+--- bluez-4.101.orig/test/l2test.c
++++ bluez-4.101/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 encryption_request = 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 (encryption_request)
+               opt |= L2CAP_LM_ENCRYPT;
+       if (secure)
+               opt |= L2CAP_LM_SECURE;
+@@ -475,7 +475,7 @@ static void do_listen(void (*handler)(in
+               opt |= L2CAP_LM_MASTER;
+       if (auth)
+               opt |= L2CAP_LM_AUTH;
+-      if (encrypt)
++      if (encryption_request)
+               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;
++                      encryption_request = 1;
+                       break;
+               case 'S':
+Index: bluez-4.101/test/rctest.c
+===================================================================
+--- bluez-4.101.orig/test/rctest.c
++++ bluez-4.101/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 encryption_request = 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 (encryption_request)
+               opt |= RFCOMM_LM_ENCRYPT;
+       if (secure)
+               opt |= RFCOMM_LM_SECURE;
+@@ -291,7 +291,7 @@ static void do_listen(void (*handler)(in
+               opt |= RFCOMM_LM_MASTER;
+       if (auth)
+               opt |= RFCOMM_LM_AUTH;
+-      if (encrypt)
++      if (encryption_request)
+               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;
++                      encryption_request = 1;
+                       break;
+               case 'S':
+Index: bluez-4.101/src/textfile.h
+===================================================================
+--- bluez-4.101.orig/src/textfile.h
++++ bluez-4.101/src/textfile.h
+@@ -24,6 +24,8 @@
+ #ifndef __TEXTFILE_H
+ #define __TEXTFILE_H
++#include <sys/types.h>
++
+ int create_dirs(const char *filename, const mode_t mode);
+ int create_file(const char *filename, const mode_t mode);
+ int create_name(char *buf, size_t size, const char *path,
+Index: bluez-4.101/test/attest.c
+===================================================================
+--- bluez-4.101.orig/test/attest.c
++++ bluez-4.101/test/attest.c
+@@ -34,6 +34,7 @@
+ #include <termios.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
++#include <sys/select.h>
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
index 28a94ed127ca35f1fe09ce43bd9db608363c2008..f900c7c7b00925a8440bf4b9b318c74f7381d827 100644 (file)
@@ -9,6 +9,7 @@ SRC_URI += "file://bluetooth.conf \
             file://network-fix-network-Connect-method-parameters.patch \
             file://install-test-script.patch \
             file://use-legacy-pygobject-instead-ofgobject-introspection.patch \
+            file://fix_encrypt_collision.patch \
 "
 
 SRC_URI[md5sum] = "fb42cb7038c380eb0e2fa208987c96ad"