summaryrefslogtreecommitdiff
path: root/lib/tdb2
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:13:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:13:13 +0930
commit6b11a2630123453a7f40f728641882c440b57010 (patch)
tree028c4379cae21c8d00e1de170fe8307879f78af6 /lib/tdb2
parentd26908846a84bcff7860ebdb384bbff030206675 (diff)
downloadsamba-6b11a2630123453a7f40f728641882c440b57010.tar.gz
samba-6b11a2630123453a7f40f728641882c440b57010.tar.bz2
samba-6b11a2630123453a7f40f728641882c440b57010.zip
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)
Diffstat (limited to 'lib/tdb2')
-rw-r--r--lib/tdb2/tdb1_lock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tdb2/tdb1_lock.c b/lib/tdb2/tdb1_lock.c
index e59874fb2f..5cc0ad6567 100644
--- a/lib/tdb2/tdb1_lock.c
+++ b/lib/tdb2/tdb1_lock.c
@@ -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;
}