diff options
author | Sjoerd Simons <sjoerd@luon.net> | 2006-09-17 22:26:24 +0200 |
---|---|---|
committer | Sjoerd Simons <sjoerd@luon.net> | 2006-09-27 21:14:22 +0200 |
commit | e29998967c7d687581c780cb973b03bba3d41e62 (patch) | |
tree | ddad1406c1b733945cef6b7157fe85ff8015ffc4 | |
parent | 0b6ef0ec9a040906515ed097c0a939a35f8dcfc3 (diff) |
create one common fallback for system.formfactor
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.
(cherry picked from 80b89a74fe53fb036b5826fbea4ebec18d3378c8 commit)
-rw-r--r-- | hald/linux/osspec.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c index cb767f6c..a2a19986 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 (HalDevice *d, guint32 exit_type, 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 (HalDevice *d, guint32 exit_type, } } - } else { - /* set a default value */ - hal_device_property_set_string (d, "system.formfactor", "unknown"); - } + } } out: computer_probing_helper_done (d); @@ -615,12 +613,10 @@ 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 */ probe_openfirmware(root); computer_probing_helper_done (root); - } + } } DBusHandlerResult |