summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2007-02-12 18:32:28 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2007-02-12 18:32:28 +0000
commit761bfdca711fcfd38a1be2f15119ec3a6a0d63ee (patch)
treeeec59e0cb51478a18b3512bfd4d2e8e4dd02b56d
parent4f2ab4a21f451bace3a029be94419489b17cf15d (diff)
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!
-rw-r--r--packages/bluez/bluez-utils.inc3
-rw-r--r--packages/bluez/bluez-utils/handle-eintr.patch23
-rw-r--r--packages/bluez/bluez-utils_3.9.bb2
3 files changed, 27 insertions, 1 deletions
diff --git a/packages/bluez/bluez-utils.inc b/packages/bluez/bluez-utils.inc
index 912c419f8c..21cbea1b70 100644
--- a/packages/bluez/bluez-utils.inc
+++ b/packages/bluez/bluez-utils.inc
@@ -11,7 +11,8 @@ LICENSE = "GPL"
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...
diff --git a/packages/bluez/bluez-utils/handle-eintr.patch b/packages/bluez/bluez-utils/handle-eintr.patch
new file mode 100644
index 0000000000..effe5d9696
--- /dev/null
+++ b/packages/bluez/bluez-utils/handle-eintr.patch
@@ -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;
+ }
+
diff --git a/packages/bluez/bluez-utils_3.9.bb b/packages/bluez/bluez-utils_3.9.bb
index d07c68b7d7..9346fff13b 100644
--- a/packages/bluez/bluez-utils_3.9.bb
+++ b/packages/bluez/bluez-utils_3.9.bb
@@ -1 +1,3 @@
require bluez-utils.inc
+
+PR = "r1"