mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-17 01:04:40 +08:00
Input: added extra GIOConditon(HUP, ERR and NVAL) for watches
This commit is contained in:
parent
b9eed677c4
commit
d539359952
@ -747,7 +747,8 @@ static int l2cap_connect(struct input_device *idev,
|
||||
if (!(errno == EAGAIN || errno == EINPROGRESS))
|
||||
goto failed;
|
||||
|
||||
g_io_add_watch(io, G_IO_OUT, (GIOFunc) cb, idev);
|
||||
g_io_add_watch(io, G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
|
||||
(GIOFunc) cb, idev);
|
||||
} else {
|
||||
cb(io, G_IO_OUT, idev);
|
||||
}
|
||||
@ -774,6 +775,14 @@ static gboolean interrupt_connect_cb(GIOChannel *chan, GIOCondition cond,
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (cond & (G_IO_HUP | G_IO_ERR)) {
|
||||
err = EINTR;
|
||||
isk = -1;
|
||||
error("Hangup or error on HIDP interrupt socket");
|
||||
goto failed;
|
||||
|
||||
}
|
||||
|
||||
isk = g_io_channel_unix_get_fd(chan);
|
||||
idev->hidp.intr_sock = isk;
|
||||
idev->hidp.idle_to = 30 * 60; /* 30 minutes */
|
||||
@ -850,6 +859,14 @@ static gboolean control_connect_cb(GIOChannel *chan, GIOCondition cond,
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (cond & (G_IO_HUP | G_IO_ERR)) {
|
||||
err = EINTR;
|
||||
csk = -1;
|
||||
error("Hangup or error on HIDP control socket");
|
||||
goto failed;
|
||||
|
||||
}
|
||||
|
||||
csk = g_io_channel_unix_get_fd(chan);
|
||||
/* Set HID control channel */
|
||||
idev->hidp.ctrl_sock = csk;
|
||||
|
Loading…
Reference in New Issue
Block a user