- found = 1;
- dbg("looking at bus '%s' for specific file '%s'", devices_dev->bus, busfile->file);
- if (sysfs_get_device_attr(devices_dev, busfile->file) != NULL) {
+ char filename[SYSFS_PATH_MAX];
+ struct stat stats;
+
+ found_bus_type = 1;
+ snprintf(filename, SYSFS_PATH_MAX-1, "%s/%s", devices_dev->path, busfile->file);
+ dbg("looking at bus '%s' for specific file '%s'", devices_dev->bus, filename);
+
+ if (stat(filename, &stats) == 0) {