hal: Branch 'master' - 2 commits

Danny Kukawka dkukawka at kemper.freedesktop.org
Tue Nov 14 10:27:20 PST 2006


 hald/linux/blockdev.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

New commits:
diff-tree 3d8bf144f9f2f8809baedc8b52631967db0e980b (from parents)
Merge: b644d7fe9899f863013cc025764dd86c763e54ba a23312cd3c6673d735e63abf459c78810fe96f66
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Tue Nov 14 18:22:33 2006 +0100

    Merge branch 'master' of ssh://dkukawka@git.freedesktop.org/git/hal

diff-tree b644d7fe9899f863013cc025764dd86c763e54ba (from 754066cd7a0929c19cd9a0faf30844c8c9047bb9)
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Tue Nov 14 18:18:54 2006 +0100

    replace usage of g_assert() with error handling
    
    This removes the only one g_assert() within the complete daemon from
    blockdev.c and replace this with code to check also the tdl instead of
    only gdl and go to the (already existing) error case if HAL don't get
    the device  searching for and simply print a warning and error mesage
    and don't add the device to the device tree. In worst case we have
    just have one device less instead of dead HAL.
    
    Without the fix HAL die without any message sometimes on boot. See:
    https://bugzilla.novell.com/show_bug.cgi?id=217563 or
    https://bugs.freedesktop.org/show_bug.cgi?id=8210

diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index b3f9b11..b7b2b86 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -832,7 +832,13 @@ hotplug_event_begin_add_blockdev (const 
 
 			/* Find device */
 			d_it = hal_device_store_find (hald_get_gdl (), udi_it);
-			g_assert (d_it != NULL);
+			if (d_it == NULL) { 
+				d_it = hal_device_store_find (hald_get_tdl (), udi_it);
+				if (d_it == NULL) {
+					HAL_WARNING (("Could not get device '%s' from gdl or tdl.", udi_it));
+					goto error;
+				}
+			}
 
 			/* Check info.bus */
 			if ((bus = hal_device_property_get_string (d_it, "info.bus")) != NULL) {


More information about the hal-commit mailing list