- BDB docs state that db->verify() doesn't perform any locking even
when used within an environment, and should only be used on files
that are not being modified by another thread of control. Grabbing
the transaction lock while verifying mostly ensures nobodys writing
to the db behind our back.
int rpmtsVerifyDB(rpmts ts)
{
- return rpmdbVerify(ts->rootDir);
+ int rc = -1;
+ rpmlock lock = rpmtsAcquireLock(ts);
+ if (lock) {
+ int rc = rpmdbVerify(ts->rootDir);
+ rpmlockFree(lock);
+ }
+ return rc;
}
/* keyp might no be defined. */