]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
sysfs: dprintf when we fail to write a sysfs file
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index 8b6baa6123773a279faf2c900d8a59881d50292a..7a39187e28cacd3b1018f88d3ac454831e805e99 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -844,6 +844,14 @@ static inline int is_subarray(char *vers)
        return (*vers == '/' || *vers == '-');
 }
 
+#ifdef DEBUG
+#define dprintf(fmt, arg...) \
+       fprintf(stderr, fmt, ##arg)
+#else
+#define dprintf(fmt, arg...) \
+        ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
+#endif
+
 #define        LEVEL_MULTIPATH         (-4)
 #define        LEVEL_LINEAR            (-1)
 #define        LEVEL_FAULTY            (-5)