tdb: Add new function tdb_transaction_active()
[metze/samba/wip.git] / lib / tdb / common / transaction.c
index 420e754d9b6e36c1aabcc6bb09ac296cd6f61829..9b975eaa0476ed783caf2b201efcc195a4e9cfe7 100644 (file)
@@ -412,6 +412,14 @@ static const struct tdb_methods transaction_methods = {
        transaction_expand_file,
 };
 
+/*
+ * Is a transaction currently active on this context?
+ *
+ */
+_PUBLIC_ bool tdb_transaction_active(struct tdb_context *tdb)
+{
+       return (tdb->transaction != NULL);
+}
 
 /*
   start a tdb transaction. No token is returned, as only a single