- continue;
- }
-
- snprintf(dirname2, MAX_PATHLEN, "%s/%s", dirname, dent2->d_name);
- dirname2[MAX_PATHLEN-1] = '\0';
- dir3 = opendir(dirname2);
- if (dir3 != NULL) {
- for (dent3 = readdir(dir3); dent3 != NULL; dent3 = readdir(dir3)) {
- char filename[MAX_PATHLEN];
-
- /* pass devices with a "dev" file */
- if (strcmp(dent3->d_name, "dev") == 0) {
- snprintf(filename, MAX_PATHLEN, "/class/%s/%s",
- dent->d_name, dent2->d_name);
- filename[MAX_PATHLEN-1] = '\0';
- device_list_insert(filename, dent->d_name, &device_list);
- break;
- }
- }
- closedir(dir3);
- }
+ else if (has_devt(dirname2))
+ device_list_insert(dirname2, dent->d_name, &device_list);