]> err.no Git - varnish/commitdiff
Dump errno and strerror in assert
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 10 Jul 2006 13:48:01 +0000 (13:48 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 10 Jul 2006 13:48:01 +0000 (13:48 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@406 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/shmlog.c

index a30253c0be3483c56c8c3e3eea4fd0c1ab88214f..f352886b120920319080de2708a31825b5486c75 100644 (file)
@@ -172,3 +172,16 @@ VSL_MgtInit(const char *fn, unsigned size)
        memset(VSL_stats, 0, sizeof *VSL_stats);
 }
 
+/*--------------------------------------------------------------------*/
+
+void
+__assert(const char *func, const char *file, int line, const char *failedexpr)
+{
+       (void)fprintf(stderr,
+            "\r\nAssertion failed: (%s)\n"
+            "    function %s, file %s, line %d.\n"
+            "    errno %d = \"%s\"\n", 
+            failedexpr, func, file, line, errno, strerror(errno));
+       abort();
+       /* NOTREACHED */
+}