summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-11-22 12:01:08 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-11-22 12:01:08 +0000
commitb3f669cd6704e370f68fd695d2ea66212b3371a9 (patch)
tree88112f3d2bd2fe4787656e406c51300d30d2c558 /audio
parentab5de0c3939158ce42f347100dc4a066862fd93d (diff)
Cleanup
Diffstat (limited to 'audio')
-rw-r--r--audio/headset.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 277f7f42..0fe95350 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -268,9 +268,8 @@ static gboolean server_io_cb(GIOChannel *chan, GIOCondition cond, void *data)
debug("rfcomm_connect_cb: connected to %s", connected_hs->address);
- g_io_add_watch(connected_hs->rfcomm,
- G_IO_ERR | G_IO_HUP | G_IO_IN | G_IO_NVAL,
- (GIOFunc) rfcomm_io_cb, connected_hs);
+ g_io_add_watch(connected_hs->rfcomm, G_IO_IN, (GIOFunc) rfcomm_io_cb,
+ connected_hs);
return TRUE;
}
@@ -280,7 +279,6 @@ static gboolean rfcomm_connect_cb(GIOChannel *chan, GIOCondition cond, struct pe
{
int sk, ret, err;
socklen_t len;
- struct hs_connection *hs;
if (cond & G_IO_NVAL) {
g_io_channel_unref(chan);
@@ -302,24 +300,21 @@ static gboolean rfcomm_connect_cb(GIOChannel *chan, GIOCondition cond, struct pe
goto failed;
}
- hs = malloc(sizeof(struct hs_connection));
- if (!hs) {
+ connected_hs = malloc(sizeof(struct hs_connection));
+ if (!connected_hs) {
err = ENOMEM;
error("Allocating new hs connection struct failed!");
goto failed;
}
- memset(hs, 0, sizeof(struct hs_connection));
-
- ba2str(&c->bda, hs->address);
- hs->rfcomm = chan;
+ memset(connected_hs, 0, sizeof(struct hs_connection));
- debug("rfcomm_connect_cb: connected to %s", hs->address);
+ ba2str(&c->bda, connected_hs->address);
+ connected_hs->rfcomm = chan;
- connected_hs = hs;
+ debug("rfcomm_connect_cb: connected to %s", connected_hs->address);
- g_io_add_watch(chan, G_IO_ERR | G_IO_HUP | G_IO_IN | G_IO_NVAL,
- (GIOFunc) rfcomm_io_cb, hs);
+ g_io_add_watch(chan, G_IO_IN, (GIOFunc) rfcomm_io_cb, connected_hs);
pending_connect_free(c, FALSE);
@@ -612,8 +607,7 @@ static void create_server_socket(void)
return;
}
- g_io_add_watch(server_sk, G_IO_IN | G_IO_ERR | G_IO_HUP,
- (GIOFunc) server_io_cb, NULL);
+ g_io_add_watch(server_sk, G_IO_IN, (GIOFunc) server_io_cb, NULL);
}