diff options
author | Jinhyung Choi <jinh0.choi@samsung.com> | 2016-03-23 20:28:41 +0900 |
---|---|---|
committer | Jinhyung Choi <jinh0.choi@samsung.com> | 2016-03-23 20:28:41 +0900 |
commit | 4821e0e31436035f3754b7bf9ae25871e342e099 (patch) | |
tree | 4dfa0e154d3fce8cdfb80c8b8b87b47a6ada587e | |
parent | 0668f6240fd85cf49b508d8d321f59320d442dde (diff) | |
download | device-manager-plugin-emul-4821e0e31436035f3754b7bf9ae25871e342e099.tar.gz device-manager-plugin-emul-4821e0e31436035f3754b7bf9ae25871e342e099.tar.bz2 device-manager-plugin-emul-4821e0e31436035f3754b7bf9ae25871e342e099.zip |
source: fix readdir_r bug
Change-Id: I57bedffa51aa353c88c6e960dcd1a219fa903d30
Signed-off-by: Jinhyung Choi <jinh0.choi@samsung.com>
-rw-r--r-- | src/device_manager_plugin_emul.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/device_manager_plugin_emul.c b/src/device_manager_plugin_emul.c index c99a455..137cd39 100644 --- a/src/device_manager_plugin_emul.c +++ b/src/device_manager_plugin_emul.c @@ -256,7 +256,7 @@ static int OEM_sys_display_info(struct display_info *disp_info) index = 0; dirp = opendir(bl_path); if (dirp) { - while (!readdir_r(dirp, &entry, &dent)) { + while (!readdir_r(dirp, &entry, &dent) && dent) { if (index >= DISP_MAX) { devmgr_log("supports %d display node", DISP_MAX); break; @@ -279,7 +279,7 @@ static int OEM_sys_display_info(struct display_info *disp_info) index = 0; dirp = opendir(lcd_path); if (dirp) { - while (!readdir_r(dirp, &entry, &dent)) { + while (!readdir_r(dirp, &entry, &dent) && dent) { if (index >= DISP_MAX) { devmgr_log("supports %d display node", DISP_MAX); break; |