diff options
author | Mathias Agopian <mathias@google.com> | 2009-09-24 15:11:04 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-09-24 15:11:04 -0700 |
commit | cab816fb6d98c23a8958a5df0006d227b14d1146 (patch) | |
tree | 261512f375799303aeac33a8587e7fc79aae4ab8 /hardware.c | |
parent | 3f03e98dbf1b402334c804a3558b6d4f6042048c (diff) | |
download | hardware_libhardware-cab816fb6d98c23a8958a5df0006d227b14d1146.tar.gz hardware_libhardware-cab816fb6d98c23a8958a5df0006d227b14d1146.tar.bz2 hardware_libhardware-cab816fb6d98c23a8958a5df0006d227b14d1146.zip |
fix a bug I introduced recently where the "default" HAL module would not be loaded.
Diffstat (limited to 'hardware.c')
-rw-r--r-- | hardware.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -46,8 +46,7 @@ static const char *variant_keys[] = { file on the emulator. */ "ro.product.board", "ro.board.platform", - "ro.arch", - "default" + "ro.arch" }; static const int HAL_VARIANT_KEYS_COUNT = @@ -133,11 +132,17 @@ int hw_get_module(const char *id, const struct hw_module_t **module) */ /* Loop through the configuration variants looking for a module */ - for (i=0 ; i<HAL_VARIANT_KEYS_COUNT ; i++) { - if (property_get(variant_keys[i], prop, NULL) == 0) { - continue; + for (i=0 ; i<HAL_VARIANT_KEYS_COUNT+1 ; i++) { + if (i < HAL_VARIANT_KEYS_COUNT) { + if (property_get(variant_keys[i], prop, NULL) == 0) { + continue; + } + snprintf(path, sizeof(path), "%s/%s.%s.so", + HAL_LIBRARY_PATH, id, prop); + } else { + snprintf(path, sizeof(path), "%s/%s.default.so", + HAL_LIBRARY_PATH, id); } - snprintf(path, sizeof(path), "%s/%s.%s.so", HAL_LIBRARY_PATH, id, prop); if (access(path, R_OK)) { continue; } |