summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-12 15:07:06 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-12 15:07:06 +0100
commit6b67e301c12bbac49eb8d8d5fa37895de740378a (patch)
treef71eddf74e8b53f1190be31a9fd8a3acdc0aa782 /modules
parent08580518f772b1b19225a540ac4190d3446e208e (diff)
parent7659cdd34d33498b3e172730a888f8ea793e1ef3 (diff)
downloadhardware_libhardware-6b67e301c12bbac49eb8d8d5fa37895de740378a.zip
hardware_libhardware-6b67e301c12bbac49eb8d8d5fa37895de740378a.tar.gz
hardware_libhardware-6b67e301c12bbac49eb8d8d5fa37895de740378a.tar.bz2
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_hardware_libhardware into replicant-6.0
Diffstat (limited to 'modules')
-rw-r--r--modules/sensors/multihal.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp
index 5fedd4d..48f2be3 100644
--- a/modules/sensors/multihal.cpp
+++ b/modules/sensors/multihal.cpp
@@ -36,6 +36,8 @@
#include <dlfcn.h>
#include <SensorEventQueue.h>
+#include <limits.h>
+#include <stdlib.h>
static const char* CONFIG_FILENAME = "/system/etc/sensors/hals.conf";
static const int MAX_CONF_LINE_LENGTH = 1024;
@@ -488,14 +490,14 @@ static void lazy_init_modules() {
pthread_mutex_unlock(&init_modules_mutex);
return;
}
- std::vector<std::string> *so_paths = new std::vector<std::string>();
- get_so_paths(so_paths);
+ std::vector<std::string> so_paths;
+ get_so_paths(&so_paths);
// dlopen the module files and cache their module symbols in sub_hw_modules
sub_hw_modules = new std::vector<hw_module_t *>();
dlerror(); // clear any old errors
const char* sym = HAL_MODULE_INFO_SYM_AS_STR;
- for (std::vector<std::string>::iterator it = so_paths->begin(); it != so_paths->end(); it++) {
+ for (std::vector<std::string>::iterator it = so_paths.begin(); it != so_paths.end(); it++) {
const char* path = it->c_str();
void* lib_handle = dlopen(path, RTLD_LAZY);
if (lib_handle == NULL) {