Commit ba5bb8ea authored by Rusty Russell's avatar Rusty Russell

tdb2: fix bogus error from tdb_unlockall() after fork in tdb1 backend.

We're always allowed to unlock after a fork; by setting the count to 0
before calling the generic unlock function we don't trigger the pid
check.
parent bef6f1b0
......@@ -384,15 +384,15 @@ int tdb1_allrecord_unlock(struct tdb_context *tdb, int ltype)
return 0;
}
tdb->file->allrecord_lock.count = 0;
tdb->file->allrecord_lock.ltype = 0;
if (tdb1_brunlock(tdb, ltype, TDB1_FREELIST_TOP, 0)) {
tdb_logerr(tdb, tdb->last_error, TDB_LOG_ERROR,
"tdb1_unlockall failed (%s)", strerror(errno));
return -1;
}
tdb->file->allrecord_lock.count = 0;
tdb->file->allrecord_lock.ltype = 0;
return 0;
}
......
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