sensord: fix the bug that handles are pushed to a list regardless of return value 53/95453/1
authorkibak.yoon <kibak.yoon@samsung.com>
Thu, 3 Nov 2016 08:48:16 +0000 (17:48 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Thu, 3 Nov 2016 09:06:56 +0000 (18:06 +0900)
Change-Id: Ibf13b5262ae66274b758b065822c634959f5bbbb
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/server/sensor_loader.cpp

index 89d678b..f606d29 100644 (file)
@@ -105,8 +105,8 @@ bool sensor_loader::load(void)
        for_each(unique_device_hal_paths.begin(), unique_device_hal_paths.end(),
                [&](const string &path) {
                        void *handle;
-                       load_sensor_devices(path, handle);
-                       m_handles.push_back(handle);
+                       if (load_sensor_devices(path, handle))
+                               m_handles.push_back(handle);
                }
        );