OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a964f0
)
emulator/hciemu: Fix not handling failed read correctly
author
Szymon Janc
<szymon.janc@tieto.com>
Thu, 25 Sep 2014 10:33:53 +0000
(12:33 +0200)
committer
Szymon Janc
<szymon.janc@tieto.com>
Mon, 29 Sep 2014 08:02:28 +0000
(10:02 +0200)
If read failed due to signal or blocking watch was removed resulting
in closing /dev/vhci and emulated adapter being removed.
This was affecting android-tester since premature removal of adapter
is considered error on android daemon.
emulator/hciemu.c
patch
|
blob
|
history
diff --git
a/emulator/hciemu.c
b/emulator/hciemu.c
index
50285e4
..
fcaeb70
100644
(file)
--- a/
emulator/hciemu.c
+++ b/
emulator/hciemu.c
@@
-179,6
+179,13
@@
static gboolean receive_btdev(GIOChannel *channel, GIOCondition condition,
fd = g_io_channel_unix_get_fd(channel);
len = read(fd, buf, sizeof(buf));
+ if (len < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ return TRUE;
+
+ return FALSE;
+ }
+
if (len < 1)
return FALSE;