summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2011-11-12 13:59:18 -0800
committerGeoff Levand <geoff@infradead.org>2011-11-12 14:05:31 -0800
commitc75e362781057bc982799d300eebfd47417ad23e (patch)
treea8f1b22376d896d165f5c8bb7c0c3c7d3e81e0e9 /lib
parentf5d6bf0af6aa5e6f1d51e00a617910ddfb76e32c (diff)
downloadtalos-petitboot-c75e362781057bc982799d300eebfd47417ad23e.tar.gz
talos-petitboot-c75e362781057bc982799d300eebfd47417ad23e.zip
Add custom TALLOC_ABORT
Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/talloc/talloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 95a0a6a..dd10893 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -41,6 +41,13 @@
#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
OpenPOWER on IntegriCloud