diff options
author | Paul Sokolovsky <pmiscml@gmail.com> | 2007-02-12 18:32:28 +0000 |
---|---|---|
committer | Paul Sokolovsky <pmiscml@gmail.com> | 2007-02-12 18:32:28 +0000 |
commit | 761bfdca711fcfd38a1be2f15119ec3a6a0d63ee (patch) | |
tree | eec59e0cb51478a18b3512bfd4d2e8e4dd02b56d /packages/bluez/bluez-utils | |
parent | 4f2ab4a21f451bace3a029be94419489b17cf15d (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!
Diffstat (limited to 'packages/bluez/bluez-utils')
-rw-r--r-- | packages/bluez/bluez-utils/handle-eintr.patch | 23 |
1 files changed, 23 insertions, 0 deletions
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; + } + |