]> git.ozlabs.org Git - petitboot/commitdiff
Add custom TALLOC_ABORT
authorGeoff Levand <geoff@infradead.org>
Sat, 12 Nov 2011 21:59:18 +0000 (13:59 -0800)
committerGeoff Levand <geoff@infradead.org>
Sat, 12 Nov 2011 22:05:31 +0000 (14:05 -0800)
Signed-off-by: Geoff Levand <geoff@infradead.org>
lib/talloc/talloc.c

index 95a0a6a0b395a82990170e1efae5227f8fdce544..dd108938759e2629737ddd20e9880642cd390c30 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
 #include <stdlib.h>
 #include <string.h>
 
+#if !defined(NDEBUG)
+#include <assert.h>
+#define TALLOC_ABORT(reason) do{ \
+       fprintf(stderr, "%s: name: %s\n", __func__, tc->name); \
+       assert(0 && reason);} while (0)
+#endif
+
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif