return 0;
}
#endif
-
+
#define declare_sysfs_get_str(fname, fmt) \
extern int \
sysfs_get_##fname (char * sysfs_path, char * dev, char * buff, int len) \
return 0;
}
-static void
+static int
sysfs_get_bus (char * sysfs_path, struct path * curpath)
{
struct sysfs_device *sdev;
if(safe_sprintf(attr_path, "%s/block/%s/device",
sysfs_path, curpath->dev)) {
condlog(0, "attr_path too small");
- return;
+ return 1;
}
if (0 > sysfs_get_link(attr_path, attr_buff, sizeof(attr_buff)))
- return;
+ return 1;
sdev = sysfs_open_device_path(attr_buff);
sysfs_close_device(sdev);
- return;
+ return 0;
}
static int
static int
common_sysfs_pathinfo (struct path * curpath)
{
- sysfs_get_bus(sysfs_path, curpath);
+ if (sysfs_get_bus(sysfs_path, curpath))
+ return 1;
+
condlog(3, "bus = %i", curpath->bus);
if (sysfs_get_dev(sysfs_path, curpath->dev,