]> err.no Git - varnish/commitdiff
Give xxxasserts their own backend with a different message.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 24 Aug 2006 07:10:35 +0000 (07:10 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 24 Aug 2006 07:10:35 +0000 (07:10 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@912 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/include/libvarnish.h
varnish-cache/lib/libvarnish/assert.c

index 08388c63eef7a3ffa121fb518f8c01f2fc1be6bd..1580fed4a2d31f167c994e552ee09010cc07d414 100644 (file)
@@ -40,10 +40,11 @@ do {                                                                        \
 #define xxxassert(e)                                                   \
 do {                                                                   \
        if (!(e))                                                       \
-               lbv_assert("XXX:" __func__, __FILE__, __LINE__, #e, errno); \
+               lbv_xxxassert(__func__, __FILE__, __LINE__, #e, errno); \
 } while (0)
 
 void lbv_assert(const char *, const char *, int, const char *, int);
+void lbv_xxxassert(const char *, const char *, int, const char *, int);
 
 /* Assert zero return value */
 #define AZ(foo)        do { assert((foo) == 0); } while (0)
index 0b155b88d32f22a15e511bac2688575d23f9d0e5..81408c3aeab3ef5f1beca65abaaf8a06806b9034 100644 (file)
@@ -9,6 +9,17 @@
 
 #include "libvarnish.h"
 
+void
+lbv_xxxassert(const char *func, const char *file, int line, const char *cond, int err)
+{
+
+       fprintf(stderr,
+           "Missing errorhandling code in %s(), %s line %d:\n"
+           "  Condition(%s) not true.\n"
+           "  errno = %d (%s)\n", func, file, line, cond, err, strerror(err));
+       abort();
+}
+
 void
 lbv_assert(const char *func, const char *file, int line, const char *cond, int err)
 {