diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 08:12:13 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 08:12:13 +0930 |
commit | d26908846a84bcff7860ebdb384bbff030206675 (patch) | |
tree | 6589b8a22fa0fab916600683a36fccb06e7c3282 /lib/tdb2/private.h | |
parent | 85fe9cffe529fd6a8c76ca5f0e3c68c090ce25bf (diff) | |
download | samba-d26908846a84bcff7860ebdb384bbff030206675.tar.gz samba-d26908846a84bcff7860ebdb384bbff030206675.tar.xz samba-d26908846a84bcff7860ebdb384bbff030206675.zip |
tdb2: check lock owner in tdb1 backend.
This reports errors if we fork() while holding a lock, or misuse a tdb
which we have dual-opened.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit bef6f1b02e95370ecb2cb44be87c82afc9cb74b2)
Diffstat (limited to 'lib/tdb2/private.h')
-rw-r--r-- | lib/tdb2/private.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tdb2/private.h b/lib/tdb2/private.h index 6e28692c34..715bd1def7 100644 --- a/lib/tdb2/private.h +++ b/lib/tdb2/private.h @@ -475,6 +475,12 @@ enum TDB_ERROR tdb_read_convert(struct tdb_context *tdb, tdb_off_t off, void tdb_inc_seqnum(struct tdb_context *tdb); /* lock.c: */ +/* Print message because another tdb owns a lock we want. */ +enum TDB_ERROR owner_conflict(struct tdb_context *tdb, const char *call); + +/* If we fork, we no longer really own locks. */ +bool check_lock_pid(struct tdb_context *tdb, const char *call, bool log); + /* Lock/unlock a range of hashes. */ enum TDB_ERROR tdb_lock_hashes(struct tdb_context *tdb, tdb_off_t hash_lock, tdb_len_t hash_range, |