Input: added extra GIOConditon(HUP, ERR and NVAL) for watches

This commit is contained in:
Claudio Takahasi 2007-03-05 20:10:35 +00:00
parent b9eed677c4
commit d539359952

View File

@ -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;