]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
Merge branch 'master' into scratch-3.0
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index e75648bae10f6f2a2db466656ac287f77bbc3382..82205355131ca3c6f1fcc5aa2d6491fa29cf4cef 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -880,6 +880,17 @@ static inline int is_subarray(char *vers)
 #define dprintf(fmt, arg...) \
         ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
 #endif
+#include <assert.h>
+#include <stdarg.h>
+static inline int xasprintf(char **strp, const char *fmt, ...) {
+       va_list ap;
+       int ret;
+       va_start(ap, fmt);
+       ret = asprintf(strp, fmt, ap);
+       va_end(ap);
+       assert(ret >= 0);
+       return ret;
+}
 
 #define        LEVEL_MULTIPATH         (-4)
 #define        LEVEL_LINEAR            (-1)