@@ -197,7 +197,7 @@
}
#endif
-#define declare_sysfs_get_str(fname, fmt) \
+#define declare_sysfs_get_str(fname, fmt, dowait) \
extern int \
sysfs_get_##fname (char * sysfs_path, char * dev, char * buff, int len) \
{ \
@@ -207,7 +207,7 @@
if (safe_sprintf(attr_path, fmt, sysfs_path, dev)) \
return 1; \
\
- if (wait_for_file(attr_path)) \
+ if (dowait && wait_for_file(attr_path)) \
return 1; \
\
if (!(attr = sysfs_open_attribute(attr_path))) \
@@ -228,14 +228,14 @@
return 1; \
}
-declare_sysfs_get_str(devtype, "%s/block/%s/device/devtype");
-declare_sysfs_get_str(cutype, "%s/block/%s/device/cutype");
-declare_sysfs_get_str(vendor, "%s/block/%s/device/vendor");
-declare_sysfs_get_str(model, "%s/block/%s/device/model");
-declare_sysfs_get_str(rev, "%s/block/%s/device/rev");
-declare_sysfs_get_str(dev, "%s/block/%s/dev");
-declare_sysfs_get_str(bustype, "%s/block/%s/device/bus");
-declare_sysfs_get_str(state, "%s/block/%s/device/state");
+declare_sysfs_get_str(devtype, "%s/block/%s/device/devtype", 1);
+declare_sysfs_get_str(cutype, "%s/block/%s/device/cutype", 1);
+declare_sysfs_get_str(vendor, "%s/block/%s/device/vendor", 1);
+declare_sysfs_get_str(model, "%s/block/%s/device/model", 1);
+declare_sysfs_get_str(rev, "%s/block/%s/device/rev", 1);
+declare_sysfs_get_str(dev, "%s/block/%s/dev", 1);
+declare_sysfs_get_str(bustype, "%s/block/%s/device/bus", 1);
+declare_sysfs_get_str(state, "%s/block/%s/device/state", 0);
int
sysfs_get_size (char * sysfs_path, char * dev, unsigned long long * size)