hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Tue Jul 17 18:43:25 EEST 2007


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

New commits:
diff-tree ddc1015be5e210cad4739fcfccfecb27fca754c8 (from 5509d85896d057d025d9a5a30c4042e9efb71ce8)
Author: Andrey Borzenkov <arvidjaar at mail.ru>
Date:   Tue Jul 17 11:43:29 2007 -0400

    allow IDE media detection if /proc/ide is missing
    
    /proc/ide is optional in 2.6.22; let hald get media information from
    sysfs if /proc/ide does not exist. May be we can always do it instead.

diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index e87cc6f..2ac00d5 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -1220,6 +1220,7 @@ hotplug_event_begin_add_blockdev (const 
 			char buf[256];
 			gchar *media;
 			gchar *model;
+			struct stat st;
 
 			/* Be conservative and don't poll IDE drives at all (except CD-ROM's, see below) */
 			hal_device_property_set_bool (d, "storage.media_check_enabled", FALSE);
@@ -1229,6 +1230,12 @@ hotplug_event_begin_add_blockdev (const 
 			 * "disk", "cdrom", "tape", "floppy", "UNKNOWN"
 			 */
 			snprintf (buf, sizeof (buf), "%s/ide/%s", get_hal_proc_path (), hal_util_get_last_element (sysfs_path_real));
+			if (stat(buf, &st)) {
+				/*
+				 * /proc/ide does not exist; try with sysfs
+				 */
+				snprintf (buf, sizeof (buf), "%s/%s", sysfs_path_real, "device");
+			}
 			if ((media = hal_util_get_string_from_file (buf, "media")) != NULL) {
 				if (strcmp (media, "disk") == 0 ||
 				    strcmp (media, "cdrom") == 0 ||


More information about the hal-commit mailing list