1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

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.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit ba5bb8eae6bcd230fd5321c618d6a9d56e74e7d1)
This commit is contained in:
Rusty Russell 2011-09-14 08:13:13 +09:30
parent d26908846a
commit 6b11a26301

View File

@ -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;
}