[oe-commits] org.oe.dev bluez-utils 3.9: Add patch to handle EINTR while being attached to uart properly.

pfalcon commit openembedded-commits at lists.openembedded.org
Mon Feb 12 18:35:42 UTC 2007


bluez-utils 3.9: Add patch to handle EINTR while being attached to uart properly.
* EINTR is not really an error, but a Unix (mis)feature, and requires special
handling (i.e. retrying). Bluez authors/maintainers really should do a bit of trivial
Unix programming reading before wring BT stacks.
* Specifically EINTR happens when resuming from suspend. So, with this patch
(and assuming there're no weird APM scripts), configured BT finally survives
suspend/resume (tested on h4000). Hurrah!

Author: pfalcon at openembedded.org
Branch: org.openembedded.dev
Revision: 5ff0c6a73c856c171a050f6f6bc0df2ce24137b2
ViewMTN: http://monotone.openembedded.org/revision.psp?id=5ff0c6a73c856c171a050f6f6bc0df2ce24137b2
Files:
1
packages/bluez/bluez-utils/handle-eintr.patch
packages/bluez/bluez-utils.inc
packages/bluez/bluez-utils_3.9.bb
Diffs:

#
# mt diff -r75595250bb078a7e100758af5cacaf37e3c03572 -r5ff0c6a73c856c171a050f6f6bc0df2ce24137b2
#
# 
# 
# add_file "packages/bluez/bluez-utils/handle-eintr.patch"
#  content [9a3a4f2dc8a7c7bc97076e8cabe9619231504ebf]
# 
# patch "packages/bluez/bluez-utils.inc"
#  from [9e5793fd7989bea21449639b251a19725905a30a]
#    to [132ee5502e665895ace84ea7fe5463537850700d]
# 
# patch "packages/bluez/bluez-utils_3.9.bb"
#  from [6529fd074ce550232a9309fb6584beee29db2d14]
#    to [6248b32dee12ef32a45856fc6108cb711bc01d6b]
# 
============================================================
--- packages/bluez/bluez-utils/handle-eintr.patch	9a3a4f2dc8a7c7bc97076e8cabe9619231504ebf
+++ packages/bluez/bluez-utils/handle-eintr.patch	9a3a4f2dc8a7c7bc97076e8cabe9619231504ebf
@@ -0,0 +1,23 @@
+--- bluez-utils-3.9.org/tools/hciattach.c	2007-01-28 20:16:48.000000000 +0000
++++ bluez-utils-3.9/tools/hciattach.c	2007-02-12 16:50:49.000000000 +0000
+@@ -1135,7 +1256,7 @@
+ int main(int argc, char *argv[])
+ {
+ 	struct uart_t *u = NULL;
+-	int detach, printpid, opt, i, n, ld;
++	int detach, printpid, opt, i, n, ld, err;
+ 	int to = 5; 
+ 	int init_speed = 0;
+ 	int send_break = 0;
+@@ -1286,7 +1414,10 @@
+ 
+ 	while (!__io_canceled) {
+ 		p.revents = 0;
+-		if (poll(&p, 1, 500))
++		err = poll(&p, 1, 500);
++		if (err < 0 && errno == EINTR)
++			continue;
++		if (err)
+ 			break;
+ 	}
+ 
============================================================
--- packages/bluez/bluez-utils.inc	9e5793fd7989bea21449639b251a19725905a30a
+++ packages/bluez/bluez-utils.inc	132ee5502e665895ace84ea7fe5463537850700d
@@ -11,7 +11,8 @@ SRC_URI = "http://bluez.sourceforge.net/
 SRC_URI = "http://bluez.sourceforge.net/download/bluez-utils-${PV}.tar.gz \
 	file://hcid.conf \
 	file://02dtl1_cs.sh \
-	file://hciattach-ti-bts.patch;patch=1"
+	file://hciattach-ti-bts.patch;patch=1 \
+        file://handle-eintr.patch;patch=1"
 
 # Almost all serial CF cards w/ manfid 0x0000,0x0000 seem to use the bcs protocol
 # Let's default to that instead of 'any' until further notice...
============================================================
--- packages/bluez/bluez-utils_3.9.bb	6529fd074ce550232a9309fb6584beee29db2d14
+++ packages/bluez/bluez-utils_3.9.bb	6248b32dee12ef32a45856fc6108cb711bc01d6b
@@ -1 +1,3 @@ require bluez-utils.inc
 require bluez-utils.inc
+
+PR = "r1"






More information about the Openembedded-commits mailing list