Revert "evdev: modify a readdir() to readdir_r() for threads safety" 84/148584/1 submit/tizen/20170908.070718
authorJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 8 Sep 2017 06:37:48 +0000 (15:37 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 8 Sep 2017 06:59:34 +0000 (15:59 +0900)
This reverts commit c591233e8e242496a490f8568d2e2268e3e940b4.

Change-Id: I9a43600e88fd9cabf5278fb546f5a03b526b8fd4

src/lib/evdev/evdev.c

index 5240b4e..9121763 100644 (file)
@@ -251,24 +251,20 @@ pepper_evdev_device_probe(pepper_evdev_t *evdev, uint32_t caps)
        uint32_t probed = 0;
 
        DIR *dir_info = NULL;
-       struct dirent *dir_entry = NULL, dir_prev;
-       int ret = 0;
+       struct dirent *dir_entry = NULL;
 
        /* Probe event device nodes under /dev/input */
        dir_info = opendir("/dev/input/");
 
        if (dir_info)
        {
-               ret = readdir_r(dir_info, &dir_prev, &dir_entry);
-               while ((ret == 0) && (dir_entry != NULL))
+               while ((dir_entry = readdir(dir_info)))
                {
                        if (!strncmp(dir_entry->d_name, "event", 5))
                        {
                                if (caps & WL_SEAT_CAPABILITY_KEYBOARD)
                                        probed += _evdev_keyboard_device_open(evdev, dir_entry->d_name);
                        }
-                       dir_prev = *dir_entry;
-                       ret = readdir_r(dir_info, &dir_prev, &dir_entry);
                }
 
                closedir(dir_info);