hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Tue Jan 15 04:58:52 PST 2008


 hald/linux/addons/addon-input.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 5c2e2c152c4ddbc63d72740f3957e74f735af6b3
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Tue Jan 15 13:58:25 2008 +0100

    close fd-leaks in hald-addon-input
    
    This fixes file descriptor leaks in hald-addon-input if a handled input
    device get removed. It enable also the debug code of the addon again.

diff --git a/hald/linux/addons/addon-input.c b/hald/linux/addons/addon-input.c
index 96d422d..525cd76 100644
--- a/hald/linux/addons/addon-input.c
+++ b/hald/linux/addons/addon-input.c
@@ -304,12 +304,7 @@ event_io (GIOChannel *channel, GIOCondition condition, gpointer data)
 static void
 destroy_data (InputData *data)
 {
-	HAL_DEBUG (("Removing GIOChannel for'%s'", data->udi));
-
-	/* Null out the GIOChannel in the hash table, but
-	 * leave the key in for DeviceRemoved
-	 */
-	g_hash_table_replace (inputs, g_strdup(data->udi), NULL);
+	HAL_DEBUG (("Input device '%s' destroyed, free data.", data->udi));
 
 	g_free (data);
 }
@@ -408,8 +403,10 @@ remove_device (LibHalContext *ctx,
 		return;
 	}
 
-	if (channel)
+	if (channel) {
+		g_io_channel_shutdown(channel, FALSE, NULL);
 		g_io_channel_unref (channel);
+	}
 
 	g_hash_table_remove (inputs, udi);
 
@@ -443,7 +440,7 @@ main (int argc, char **argv)
 
 	hal_set_proc_title_init (argc, argv);
 
-	/* setup_logger (); */
+	setup_logger ();
 
 	dbus_error_init (&error);
 	if ((ctx = libhal_ctx_init_direct (&error)) == NULL) {


More information about the hal-commit mailing list