diff options
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 */  | 
