From a3ed47a09bfaf3bf100547a4d97e9d8573382a3d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 26 Jun 2012 15:02:41 +0200 Subject: s3:net registry import: improve regdb_open/close layering Pair-Programmed-With: Gregor Beck --- source3/utils/net_registry.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c index 763ed0d918..5d93a71390 100644 --- a/source3/utils/net_registry.c +++ b/source3/utils/net_registry.c @@ -1276,14 +1276,15 @@ static int net_registry_import(struct net_context *c, int argc, d_printf("%s\n%s", _("Example:"), _("net registry import file.reg enc=CP1252\n")); - goto done; + return -1; } werr = regdb_open(); if (!W_ERROR_IS_OK(werr)) { d_printf("Failed to open regdb: %s\n", win_errstr(werr)); - goto done; + return -1; } + werr = regdb_transaction_start(); if (!W_ERROR_IS_OK(werr)) { d_printf("Failed to start transaction on regdb: %s\n", @@ -1306,8 +1307,8 @@ static int net_registry_import(struct net_context *c, int argc, } } - regdb_close(); done: + regdb_close(); return ret; } /**@}*/ -- cgit