Battery (Linux): improve performance by specifying O_PATH
This commit is contained in:
1 parent
1c598add39
commit
e73d6db2e5
1 file changed
+1
-1
@@ -170,7 +170,7 @@ const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results)
|
||||
if(entry->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
FF_AUTO_CLOSE_FD int dfd = openat(dirfd(dirp), entry->d_name, O_RDONLY | O_CLOEXEC);
|
||||
FF_AUTO_CLOSE_FD int dfd = openat(dirfd(dirp), entry->d_name, O_RDONLY | O_CLOEXEC | O_PATH | O_DIRECTORY);
|
||||
if (dfd > 0) parseBattery(dfd, entry->d_name, options, results);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user