diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-04-05 19:47:27 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-04-05 19:47:27 +0000 |
commit | eac4f4085dcfbad3344109f76bce6ab2656a6b50 (patch) | |
tree | f1e2fdfdd23ccd66efc3a923e471c8867bc6f42a | |
parent | 6b9efc12eaf7ae2196bf7b80f3fc33366f97390e (diff) |
network: handle the GIOChannel errors properly
-rw-r--r-- | network/server.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/network/server.c b/network/server.c index 0c0932ae..f61d586c 100644 --- a/network/server.c +++ b/network/server.c @@ -499,7 +499,7 @@ static gboolean connect_event(GIOChannel *chan, if (cond & (G_IO_ERR | G_IO_HUP)) { error("Hangup or error on L2CAP socket PSM 15"); - /* FIXME: Notify the userspace? */ + g_io_channel_close(chan); return FALSE; } @@ -606,7 +606,7 @@ static int l2cap_listen(struct network_server *ns) } ns->io = g_io_channel_unix_new(sk); - g_io_channel_set_close_on_unref(ns->io, TRUE); + g_io_channel_set_close_on_unref(ns->io, FALSE); g_io_add_watch(ns->io, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, connect_event, ns); @@ -772,6 +772,7 @@ static DBusHandlerResult disable(DBusConnection *conn, ns->record_id = 0; } + g_io_channel_close(ns->io); g_io_channel_unref(ns->io); ns->io = NULL; |