diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-03-05 20:10:35 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-03-05 20:10:35 +0000 |
commit | d53935995279d96e4a2f973d11d3a3ba3d9c9bfc (patch) | |
tree | b2a70fae4b73cd743911151cf23802e8ebb6a7b1 /input/device.c | |
parent | b9eed677c4d83eab328d7c6ce64f90b018f3b995 (diff) |
Input: added extra GIOConditon(HUP, ERR and NVAL) for watches
Diffstat (limited to 'input/device.c')
-rw-r--r-- | input/device.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/input/device.c b/input/device.c index 2d05d264..0e182224 100644 --- a/input/device.c +++ b/input/device.c @@ -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; |