+ // try to resolve DT_UNKNOWN and symlinks\r
+ changed = 0;\r
+ for (i = 0; i < n; i++) {\r
+ struct stat st;\r
+\r
+ if (namelist[i]->d_type == DT_REG || namelist[i]->d_type == DT_DIR)\r
+ continue;\r
+\r
+ snprintf(rom_fname_reload, sizeof(rom_fname_reload),\r
+ "%s/%s", curr_path, namelist[i]->d_name);\r
+ r = stat(rom_fname_reload, &st);\r
+ if (r == 0)\r
+ {\r
+ if (S_ISREG(st.st_mode)) {\r
+ namelist[i]->d_type = DT_REG;\r
+ changed = 1;\r
+ }\r
+ else if (S_ISDIR(st.st_mode)) {\r
+ namelist[i]->d_type = DT_DIR;\r
+ changed = 1;\r
+ }\r
+ }\r
+ }\r
+\r