diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-10-23 14:46:08 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-23 14:52:18 +1100 |
commit | a32b3386473e40ec8b94703f66f731a29dba68f7 (patch) | |
tree | 2238b176f740e8a523d560234c9c868b86c54424 /source4/lib/ldb/common | |
parent | a7cc448dc232ac08bda0eef1bbc8e22b52eea5b5 (diff) | |
download | samba-a32b3386473e40ec8b94703f66f731a29dba68f7.tar.gz samba-a32b3386473e40ec8b94703f66f731a29dba68f7.tar.bz2 samba-a32b3386473e40ec8b94703f66f731a29dba68f7.zip |
s4-ldb: added ldb_transaction_cancel_noerr()
This will be used to allow cancelling of transactions in a child after
a fork()
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/ldb.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index e9c924583e..59727d75d0 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -481,6 +481,19 @@ int ldb_transaction_cancel(struct ldb_context *ldb) return status; } +/* + cancel a transaction with no error if no transaction is pending + used when we fork() to clear any parent transactions +*/ +int ldb_transaction_cancel_noerr(struct ldb_context *ldb) +{ + if (ldb->transaction_active > 0) { + return ldb_transaction_cancel(ldb); + } + return LDB_SUCCESS; +} + + /* autostarts a transacion if none active */ static int ldb_autotransaction_request(struct ldb_context *ldb, struct ldb_request *req) |