diff mbox

multipath-tools/libmultipath discovery.c

Message ID 20091123210834.23464.qmail@sourceware.org (mailing list archive)
State New, archived
Headers show

Commit Message

bmarzins@sourceware.org Nov. 23, 2009, 9:08 p.m. UTC
None
diff mbox

Patch

--- multipath-tools/libmultipath/discovery.c	2009/06/08 21:38:02	1.32.2.8
+++ multipath-tools/libmultipath/discovery.c	2009/11/23 21:08:34	1.32.2.9
@@ -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)