Skip to content

Commit 6e15a44

Browse files
committed
GPU (Linux): ignore . when enumerating directories
1 parent 6bd3d2c commit 6e15a44

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/detection/gpu/gpu_linux.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ static void pciDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult* gpu,
4646

4747
ffStrbufAppendS(pciDir, "/hwmon/");
4848
FF_AUTO_CLOSE_DIR DIR* dirp = opendir(pciDir->chars);
49-
struct dirent* entry = readdir(dirp);
49+
struct dirent* entry;
50+
while ((entry = readdir(dirp)) != NULL)
51+
{
52+
if (entry->d_name[0] == '.') continue;
53+
break;
54+
}
5055
if (!entry) return;
5156
ffStrbufAppendS(pciDir, entry->d_name);
5257
ffStrbufAppendC(pciDir, '/');

0 commit comments

Comments
 (0)