From f84e31fac1a1f7cf602afac6688bb4b9b02babb9 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 26 Jan 2007 16:21:47 +0000 Subject: Close the control and interrupt sockets after call ioctl HIDPCONNADD --- input/input-service.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/input/input-service.c b/input/input-service.c index 02903d0e..3a309068 100644 --- a/input/input-service.c +++ b/input/input-service.c @@ -473,22 +473,24 @@ static gboolean interrupt_connect_cb(GIOChannel *chan, GIOCondition cond, goto failed; } - close(ctl); send_message_and_unref(pc->conn, dbus_message_new_method_return(pc->msg)); - pending_connect_free(pc); - g_io_channel_unref(chan); - - return FALSE; - + close (ctl); + goto cleanup; failed: + err_connection_failed(pc->conn, pc->msg, strerror(err)); + +cleanup: if (isk > 0) close(isk); + close(idev->hidp.ctrl_sock); + idev->hidp.intr_sock = -1; - err_connection_failed(pc->conn, pc->msg, strerror(err)); + idev->hidp.ctrl_sock = -1; + pending_connect_free(pc); g_io_channel_unref(chan); -- cgit