Fossil SCM
Issue a panic if there is an attempt to invoke backoffice_run() more than once.
Commit
9d0bfcb3d8b75144dfe05a2f08341a7401fab2e30442dc72b77498120a167540
Parent
ac6657e2d35c974…
1 file changed
+5
+5
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -185,11 +185,16 @@ | ||
| 185 | 185 | Lease x; |
| 186 | 186 | sqlite3_uint64 tmNow; |
| 187 | 187 | sqlite3_uint64 idSelf; |
| 188 | 188 | int lastWarning = 0; |
| 189 | 189 | int warningDelay = 30; |
| 190 | + static int once = 0; | |
| 190 | 191 | |
| 192 | + if( once ){ | |
| 193 | + fossil_panic("multiple calls to backoffice_run()"); | |
| 194 | + } | |
| 195 | + once = 1; | |
| 191 | 196 | if( g.db==0 ){ |
| 192 | 197 | fossil_panic("database not open for backoffice processing"); |
| 193 | 198 | } |
| 194 | 199 | if( db_transaction_nesting_depth()!=0 ){ |
| 195 | 200 | fossil_panic("transaction %s not closed prior to backoffice processing", |
| 196 | 201 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -185,11 +185,16 @@ | |
| 185 | Lease x; |
| 186 | sqlite3_uint64 tmNow; |
| 187 | sqlite3_uint64 idSelf; |
| 188 | int lastWarning = 0; |
| 189 | int warningDelay = 30; |
| 190 | |
| 191 | if( g.db==0 ){ |
| 192 | fossil_panic("database not open for backoffice processing"); |
| 193 | } |
| 194 | if( db_transaction_nesting_depth()!=0 ){ |
| 195 | fossil_panic("transaction %s not closed prior to backoffice processing", |
| 196 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -185,11 +185,16 @@ | |
| 185 | Lease x; |
| 186 | sqlite3_uint64 tmNow; |
| 187 | sqlite3_uint64 idSelf; |
| 188 | int lastWarning = 0; |
| 189 | int warningDelay = 30; |
| 190 | static int once = 0; |
| 191 | |
| 192 | if( once ){ |
| 193 | fossil_panic("multiple calls to backoffice_run()"); |
| 194 | } |
| 195 | once = 1; |
| 196 | if( g.db==0 ){ |
| 197 | fossil_panic("database not open for backoffice processing"); |
| 198 | } |
| 199 | if( db_transaction_nesting_depth()!=0 ){ |
| 200 | fossil_panic("transaction %s not closed prior to backoffice processing", |
| 201 |