diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2007-04-04 07:30:14 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-04-04 07:30:14 +0000 |
commit | a36be2a103e95b04d5b348c83b41dc8c06439990 (patch) | |
tree | c81c054292e610b93af27a4c416fd4e5f709b5f0 | |
parent | f89882a84a048cd676798e4a047a73fb202e246d (diff) |
Fix missing G_IO_NVAL handling
-rw-r--r-- | daemon/echo.c | 4 | ||||
-rw-r--r-- | input/server.c | 4 | ||||
-rw-r--r-- | sdpd/server.c | 16 |
3 files changed, 12 insertions, 12 deletions
diff --git a/daemon/echo.c b/daemon/echo.c index 41c67559..1fe23727 100644 --- a/daemon/echo.c +++ b/daemon/echo.c @@ -55,7 +55,7 @@ static gboolean session_event(GIOChannel *chan, GIOCondition cond, gpointer data gsize len, written; GIOError err; - if (cond & (G_IO_HUP | G_IO_ERR)) + if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) return FALSE; err = g_io_channel_read(chan, (gchar *) buf, sizeof(buf), &len); @@ -104,7 +104,7 @@ static void authorization_callback(DBusPendingCall *call, void *data) dbus_error_free(&err); } else { info("Accepting incoming connection"); - g_io_add_watch(auth->io, G_IO_IN | G_IO_HUP | G_IO_ERR, + g_io_add_watch(auth->io, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, session_event, NULL); } diff --git a/input/server.c b/input/server.c index b140bb6b..911fc8e7 100644 --- a/input/server.c +++ b/input/server.c @@ -69,7 +69,7 @@ static struct session_data *find_session(bdaddr_t *src, bdaddr_t *dst) static gboolean session_event(GIOChannel *chan, GIOCondition cond, gpointer data) { - if (cond & (G_IO_HUP | G_IO_ERR)) + if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) return FALSE; return TRUE; @@ -133,7 +133,7 @@ static void create_watch(int sk, struct session_data *session) io = g_io_channel_unix_new(sk); g_io_channel_set_close_on_unref(io, TRUE); - g_io_add_watch(io, G_IO_IN | G_IO_HUP | G_IO_ERR, + g_io_add_watch(io, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, session_event, session); g_io_channel_unref(io); diff --git a/sdpd/server.c b/sdpd/server.c index 8f13a051..2abcc6bc 100644 --- a/sdpd/server.c +++ b/sdpd/server.c @@ -149,7 +149,7 @@ static gboolean io_session_event(GIOChannel *chan, GIOCondition cond, gpointer d uint8_t *buf; int sk, len, size; - if (cond & (G_IO_HUP | G_IO_ERR)) + if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) return FALSE; sk = g_io_channel_unix_get_fd(chan); @@ -181,7 +181,7 @@ static gboolean io_accept_event(GIOChannel *chan, GIOCondition cond, gpointer da GIOChannel *io; int nsk; - if (cond & (G_IO_HUP | G_IO_ERR)) { + if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) { g_io_channel_unref(chan); return FALSE; } @@ -207,8 +207,8 @@ static gboolean io_accept_event(GIOChannel *chan, GIOCondition cond, gpointer da io = g_io_channel_unix_new(nsk); g_io_channel_set_close_on_unref(io, TRUE); - g_io_add_watch(io, G_IO_IN | G_IO_ERR | G_IO_HUP, io_session_event, - data); + g_io_add_watch(io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, + io_session_event, data); g_io_channel_unref(io); @@ -231,15 +231,15 @@ int start_sdp_server(uint16_t mtu, uint32_t flags) l2cap_io = g_io_channel_unix_new(l2cap_sock); g_io_channel_set_close_on_unref(l2cap_io, TRUE); - g_io_add_watch(l2cap_io, G_IO_IN | G_IO_ERR | G_IO_HUP, - io_accept_event, &l2cap_sock); + g_io_add_watch(l2cap_io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, + io_accept_event, &l2cap_sock); if (compat && unix_sock > fileno(stderr)) { unix_io = g_io_channel_unix_new(unix_sock); g_io_channel_set_close_on_unref(unix_io, TRUE); - g_io_add_watch(unix_io, G_IO_IN | G_IO_ERR | G_IO_HUP, - io_accept_event, &unix_sock); + g_io_add_watch(unix_io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, + io_accept_event, &unix_sock); } return 0; |