hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Mon Apr 21 02:37:53 PDT 2008


 hald/linux/addons/addon-input.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 38d16647bf66f2e26a882ccd9bb5a0273278338d
Author: Jon Oberheide <jon at oberheide.org>
Date:   Mon Apr 21 11:37:45 2008 +0200

    fix input addon to handle G_IO_NVAL situations
    
    Fixed input addon to handle G_IO_NVAL situations.
    
    https://bugs.launchpad.net/ubuntu/+source/hal/+bug/203679:
    > The file descriptor is closed via remove_device() but not removed
    > from poll's fdset. Therefore poll continues to return with the
    > POLLNVAL code but it is never handled. The POLLNVAL should be
    > handled by adding G_IO_NVAL to the g_io_add_watch_full() event mask
    > and then also included in the error condition at the top of
    > event_io().

diff --git a/hald/linux/addons/addon-input.c b/hald/linux/addons/addon-input.c
index 48fd815..5704f82 100644
--- a/hald/linux/addons/addon-input.c
+++ b/hald/linux/addons/addon-input.c
@@ -210,7 +210,7 @@ event_io (GIOChannel *channel, GIOCondition condition, gpointer data)
 	GError *gerror = NULL;
 	gsize read_bytes;
 
-	if (condition & (G_IO_HUP | G_IO_ERR))
+	if (condition & (G_IO_HUP | G_IO_ERR | G_IO_NVAL))
 		return FALSE;
 
 	/** tbh, we can probably assume every time we read we have a whole
@@ -383,7 +383,7 @@ add_device (LibHalContext *ctx,
 
 	g_hash_table_insert (inputs, g_strdup(udi), channel);
 	g_io_add_watch_full (channel,
-			     G_PRIORITY_DEFAULT, G_IO_IN | G_IO_ERR | G_IO_HUP,
+			     G_PRIORITY_DEFAULT, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
 			     event_io, data, (GDestroyNotify) destroy_data);
 }
 


More information about the hal-commit mailing list