Otherwise we cannot detect the symlinks, and the directory
lookup will get into an infinite loop.
if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
continue;
if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
continue;
- if (!strcmp(dir->d_name, "device"))
- continue;
sprintf(full_path, "%s/%s", path, dir->d_name);
sprintf(full_path, "%s/%s", path, dir->d_name);
- if (stat(full_path, &st) == -1) {
+ if (lstat(full_path, &st) == -1) {