From ba0e944c46b5c5e11c2539e15c9fe099a6c39fd1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 24 Feb 2009 10:44:48 +0100 Subject: s3:registry: provide transaction_start|commit|cancel fns for the registry tdb Michael --- source3/include/proto.h | 3 +++ source3/registry/reg_backend_db.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'source3') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2d92b0fc90..559d62fec3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5049,6 +5049,9 @@ WERROR init_registry_data(void); WERROR regdb_init(void); WERROR regdb_open( void ); int regdb_close( void ); +WERROR regdb_transaction_start(void); +WERROR regdb_transaction_commit(void); +WERROR regdb_transaction_cancel(void); int regdb_get_seqnum(void); bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr); int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr); diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 689bd1038e..960e884404 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -482,6 +482,24 @@ int regdb_close( void ) return 0; } +WERROR regdb_transaction_start(void) +{ + return (regdb->transaction_start(regdb) == 0) ? + WERR_OK : WERR_REG_IO_FAILURE; +} + +WERROR regdb_transaction_commit(void) +{ + return (regdb->transaction_commit(regdb) == 0) ? + WERR_OK : WERR_REG_IO_FAILURE; +} + +WERROR regdb_transaction_cancel(void) +{ + return (regdb->transaction_cancel(regdb) == 0) ? + WERR_OK : WERR_REG_IO_FAILURE; +} + /*********************************************************************** return the tdb sequence number of the registry tdb. this is an indicator for the content of the registry -- cgit