diff options
| author | Doug Barton <dougb@FreeBSD.org> | 2012-04-04 23:39:49 +0000 |
|---|---|---|
| committer | Doug Barton <dougb@FreeBSD.org> | 2012-04-04 23:39:49 +0000 |
| commit | 65880d08f9383b1b2f7d971891cc32f9ba70e051 (patch) | |
| tree | d26f93aedd31b1ac675c005aa5330e49b0feb548 /lib/isc/assertions.c | |
| parent | 80d1ba31f126f0fc17182c5c4b40965c383b37bd (diff) | |
Diffstat (limited to 'lib/isc/assertions.c')
| -rw-r--r-- | lib/isc/assertions.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/isc/assertions.c b/lib/isc/assertions.c index b98d61de1a09..a07edd1bfcba 100644 --- a/lib/isc/assertions.c +++ b/lib/isc/assertions.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: assertions.c,v 1.23 2008-10-15 23:47:31 tbox Exp $ */ +/* $Id$ */ /*! \file */ @@ -34,20 +34,31 @@ static void default_callback(const char *, int, isc_assertiontype_t, const char *); +static isc_assertioncallback_t isc_assertion_failed_cb = default_callback; + /*% * Public. */ -LIBISC_EXTERNAL_DATA isc_assertioncallback_t isc_assertion_failed = - default_callback; +/*% assertion failed handler */ +/* coverity[+kill] */ +void +isc_assertion_failed(const char *file, int line, isc_assertiontype_t type, + const char *cond) +{ + isc_assertion_failed_cb(file, line, type, cond); + abort(); + /* NOTREACHED */ +} + /*% Set callback. */ void isc_assertion_setcallback(isc_assertioncallback_t cb) { if (cb == NULL) - isc_assertion_failed = default_callback; + isc_assertion_failed_cb = default_callback; else - isc_assertion_failed = cb; + isc_assertion_failed_cb = cb; } /*% Type to Text */ |
