diff options
author | drh <drh@noemail.net> | 2007-03-15 12:17:42 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2007-03-15 12:17:42 +0000 |
commit | d5eb79eb40e9ab3fd6a44f3c4a2bf901aa91d13c (patch) | |
tree | 037c8a0ca8cecd8b0130eaf0d084289622b2b700 /src/os_common.h | |
parent | b69d96d22c51bb16d9fbdd68c271e54956c5cb6c (diff) | |
download | sqlite-d5eb79eb40e9ab3fd6a44f3c4a2bf901aa91d13c.tar.gz sqlite-d5eb79eb40e9ab3fd6a44f3c4a2bf901aa91d13c.zip |
Infrastructure to make simulated I/O errors persistent instead of
transient. (CVS 3689)
FossilOrigin-Name: 1a53f531ecd51938fab37a59b7088d89d8f8569d
Diffstat (limited to 'src/os_common.h')
-rw-r--r-- | src/os_common.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/os_common.h b/src/os_common.h index 863e3cde2..3d379e070 100644 --- a/src/os_common.h +++ b/src/os_common.h @@ -90,13 +90,16 @@ static unsigned int elapse; #ifdef SQLITE_TEST int sqlite3_io_error_hit = 0; int sqlite3_io_error_pending = 0; +int sqlite3_io_error_persist = 0; int sqlite3_diskfull_pending = 0; int sqlite3_diskfull = 0; #define SimulateIOError(CODE) \ if( sqlite3_io_error_pending ) \ - if( sqlite3_io_error_pending-- == 1 ){ local_ioerr(); CODE; } + if( sqlite3_io_error_pending-- == 1 \ + || (sqlite3_io_error_persist && sqlite3_io_error_hit) ) \ + { local_ioerr(); CODE; } static void local_ioerr(){ - sqlite3_io_error_hit = 1; /* Really just a place to set a breakpoint */ + sqlite3_io_error_hit = 1; } #define SimulateDiskfullError(CODE) \ if( sqlite3_diskfull_pending ){ \ |