diff options
author | Michael Adam <obnox@samba.org> | 2009-07-07 12:27:26 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-07-15 14:01:47 +0200 |
commit | 6cb14409af5f708706f975143c7b40bb54c7a5c0 (patch) | |
tree | 2ff2f5f9d51529223d2b88a8c0ba76c560c674e3 /source3 | |
parent | 4eeacd6ef0e1bb813062c30ac280e542c6b007c8 (diff) | |
download | samba-6cb14409af5f708706f975143c7b40bb54c7a5c0.tar.gz samba-6cb14409af5f708706f975143c7b40bb54c7a5c0.tar.bz2 samba-6cb14409af5f708706f975143c7b40bb54c7a5c0.zip |
s3:registry: in regdb_delete_subkey(), don't use the transaction wrappers.
This way, the db handle gets used explicitly and the core of the
function can be abstracted.
Michael
Diffstat (limited to 'source3')
-rw-r--r-- | source3/registry/reg_backend_db.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 0c916a8df6..979dc1867c 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -971,7 +971,7 @@ done: static WERROR regdb_delete_subkey(const char *key, const char *subkey) { - WERROR werr, werr2; + WERROR werr; struct regsubkey_ctr *subkeys; char *path; TALLOC_CTX *mem_ctx = talloc_stackframe(); @@ -992,8 +992,10 @@ static WERROR regdb_delete_subkey(const char *key, const char *subkey) goto done; } - werr = regdb_transaction_start(); - W_ERROR_NOT_OK_GOTO_DONE(werr); + if (regdb->transaction_start(regdb) != 0) { + werr = WERR_REG_IO_FAILURE; + goto done; + } werr = regdb_delete_key_lists(regdb, path); W_ERROR_NOT_OK_GOTO(werr, cancel); @@ -1016,17 +1018,15 @@ static WERROR regdb_delete_subkey(const char *key, const char *subkey) goto cancel; } - werr = regdb_transaction_commit(); - if (!W_ERROR_IS_OK(werr)) { - DEBUG(0, (__location__ " failed to commit transaction: %s\n", - win_errstr(werr))); + if (regdb->transaction_commit(regdb) != 0) { + DEBUG(0, (__location__ " failed to commit transaction\n")); + werr = WERR_REG_IO_FAILURE; } goto done; cancel: - werr2 = regdb_transaction_cancel(); - if (!W_ERROR_IS_OK(werr2)) { + if (regdb->transaction_cancel(regdb) != 0) { smb_panic("regdb_delete_subkey: transaction_cancel failed\n"); } |