Commit dd5964ff authored by gwenn's avatar gwenn

Ignore extended error code

parent 9d694b0a
......@@ -50,7 +50,7 @@ func (b *Backup) Step(npage int32) error {
return errors.New("nil sqlite backup")
}
rv := C.sqlite3_backup_step(b.sb, C.int(npage))
if rv == C.SQLITE_OK || Errno(rv) == ErrBusy || Errno(rv) == ErrLocked { // TODO Trace busy/locked errors
if rv == C.SQLITE_OK || Errno(rv&0xFF) == ErrBusy || Errno(rv&0xFF) == ErrLocked { // TODO Trace busy/locked errors
return nil
} else if rv == C.SQLITE_DONE {
return Errno(rv)
......
......@@ -609,7 +609,7 @@ func (c *Conn) Close() error {
rv := C.sqlite3_close(c.db)
if rv == C.SQLITE_BUSY {
if rv&0xFF == C.SQLITE_BUSY {
// Dangling statements
stmt := C.sqlite3_next_stmt(c.db, nil)
for stmt != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment