mdbx-chk: use mdbx_env_stat2() and mdbx_env_stat2() to avoid races.

Change-Id: Ib956c19bec0b8bf9999cf1e97b8b630f119a0906
This commit is contained in:
Leonid Yuriev 2019-08-12 01:38:13 +03:00
parent 17407c9ecc
commit bc3d1a84cc

View File

@ -1060,13 +1060,13 @@ int main(int argc, char *argv[]) {
}
maxkeysize = rc;
rc = mdbx_env_info(env, &envinfo, sizeof(envinfo));
rc = mdbx_env_info2(env, txn, &envinfo, sizeof(envinfo));
if (rc) {
error("mdbx_env_info failed, error %d %s\n", rc, mdbx_strerror(rc));
goto bailout;
}
rc = mdbx_env_stat(env, &envstat, sizeof(envstat));
rc = mdbx_env_stat2(env, txn, &envstat, sizeof(envstat));
if (rc) {
error("mdbx_env_stat failed, error %d %s\n", rc, mdbx_strerror(rc));
goto bailout;