summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/registry/reg_backend_db.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 5c7f48923f..e87ae649ce 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -507,29 +507,29 @@ WERROR regdb_init(void)
return WERR_CAN_NOT_COMPLETE;
}
+ if (regdb->transaction_start(regdb) != 0) {
+ return WERR_REG_IO_FAILURE;
+ }
+
if (vers_id == REGVER_V1) {
DEBUG(10, ("regdb_init: got registry db version %d, upgrading "
"to version %d\n", REGVER_V1, REGVER_V2));
- if (regdb->transaction_start(regdb) != 0) {
- return WERR_REG_IO_FAILURE;
- }
-
werr = regdb_upgrade_v1_to_v2();
if (!W_ERROR_IS_OK(werr)) {
regdb->transaction_cancel(regdb);
return werr;
}
- if (regdb->transaction_commit(regdb) != 0) {
- return WERR_REG_IO_FAILURE;
- }
-
vers_id = REGVER_V2;
}
/* future upgrade code should go here */
+ if (regdb->transaction_commit(regdb) != 0) {
+ return WERR_REG_IO_FAILURE;
+ }
+
return WERR_OK;
}