mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Begin adding the failsafe() macro. (CVS 5383)
FossilOrigin-Name: 8aae4fe7e702b7636fba1fd609a0ca22fdcc3371
This commit is contained in:
16
src/util.c
16
src/util.c
@@ -14,7 +14,7 @@
|
||||
** This file contains functions for allocating memory, comparing
|
||||
** strings, and stuff like that.
|
||||
**
|
||||
** $Id: util.c,v 1.234 2008/07/08 14:52:10 drh Exp $
|
||||
** $Id: util.c,v 1.235 2008/07/09 13:28:54 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <stdarg.h>
|
||||
@@ -936,3 +936,17 @@ int sqlite3SafetyCheckSickOrOk(sqlite3 *db){
|
||||
magic!=SQLITE_MAGIC_BUSY ) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Report a failsafe() macro failure
|
||||
*/
|
||||
void sqlite3Failsafe(int iCode){
|
||||
sqlite3Config.iFailsafe = iCode;
|
||||
|
||||
/* The following assert is always false. When assert() is enabled,
|
||||
** the following causes a failsafe() failure to work like an assert()
|
||||
** failure. Normal operating mode for SQLite is for assert() to be
|
||||
** disabled, however, so the following is normally a no-op.
|
||||
*/
|
||||
assert( iCode==0 ); /* Always fails if assert() is enabled */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user