mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 18:34:12 +08:00
lmdb: mdb_chk allows interruption of b-tree travesersal.
Change-Id: Ia59236dcb575203baebf9e65310cdf1e700c33ce
This commit is contained in:
parent
37b3629329
commit
1be4140abf
@ -223,7 +223,7 @@ static int pgvisitor(size_t pgno, unsigned pgnumber, void* ctx, const char* dbi,
|
|||||||
} while(--pgnumber);
|
} while(--pgnumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
return MDB_SUCCESS;
|
return gotsignal ? EINTR : MDB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef int (visitor)(size_t record_number, MDB_val *key, MDB_val* data);
|
typedef int (visitor)(size_t record_number, MDB_val *key, MDB_val* data);
|
||||||
@ -696,7 +696,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
rc = mdb_env_pgwalk(txn, pgvisitor, NULL);
|
rc = mdb_env_pgwalk(txn, pgvisitor, NULL);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
error("mdb_env_pgwalk failed, error %d %s\n", rc, mdb_strerror(rc));
|
if (rc == EINTR && gotsignal) {
|
||||||
|
print(" - interrupted by signal\n");
|
||||||
|
} else {
|
||||||
|
error("mdb_env_pgwalk failed, error %d %s\n", rc, mdb_strerror(rc));
|
||||||
|
}
|
||||||
goto bailout;
|
goto bailout;
|
||||||
}
|
}
|
||||||
for( n = 0; n < lastpgno; ++n)
|
for( n = 0; n < lastpgno; ++n)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user