1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
commit 80b89a74fe53fb036b5826fbea4ebec18d3378c8
Author: Sjoerd Simons <sjoerd@luon.net>
Date: Sun Sep 17 22:26:24 2006 +0200
Set system.formfactor fallback in exactly one place instead of three and be
carefull not to override if already set. Fixes bug on macintosh powerpc
machines where the detected value was overriden by the fallback.
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index b9fb922..8aca683 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -346,6 +346,10 @@ hotplug_queue_now_empty (void)
static void
computer_probing_helper_done (HalDevice *d)
{
+ /* if not set, set a default value */
+ if (!hal_device_has_property (d, "system.formfactor")) {
+ hal_device_property_set_string (d, "system.formfactor", "unknown");
+ }
di_search_and_merge (d, DEVICE_INFO_TYPE_INFORMATION);
di_search_and_merge (d, DEVICE_INFO_TYPE_POLICY);
@@ -363,9 +367,6 @@ computer_probing_pcbios_helper_done (Hal
const char *system_version;
if (exit_type == HALD_RUN_FAILED) {
- /* set a default value */
- if (!hal_device_has_property (d, "system.formfactor"))
- hal_device_property_set_string (d, "system.formfactor", "unknown");
goto out;
}
@@ -433,10 +434,7 @@ computer_probing_pcbios_helper_done (Hal
}
}
- } else {
- /* set a default value */
- hal_device_property_set_string (d, "system.formfactor", "unknown");
- }
+ }
}
out:
computer_probing_helper_done (d);
@@ -554,11 +552,9 @@ osspec_probe (void)
hald_runner_run (root, "hald-probe-smbios", NULL, HAL_HELPER_TIMEOUT,
computer_probing_pcbios_helper_done, NULL, NULL);
} else {
- /* set a default value, can be overridden by others */
- hal_device_property_set_string (root, "system.formfactor", "unknown");
/* no probing */
computer_probing_helper_done (root);
- }
+ }
}
DBusHandlerResult
|