From: Michael Adam Date: Tue, 29 Apr 2008 15:18:26 +0000 (+0200) Subject: registry: check for existence of key init_registry_key and possibly save a write. X-Git-Tag: samba-4.0.0alpha6~801^2~1561 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed6a9edb1ef129f82aa7841dd18151da28b7ce6d;p=thirdparty%2Fsamba.git registry: check for existence of key init_registry_key and possibly save a write. Michael (This used to be commit 3ab5a2f1b3cf37c380ff3e45a957e62a8017814a) --- diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 33454c90645..e10cfb520ba 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -201,6 +201,10 @@ WERROR init_registry_key(const char *add_path) { WERROR werr; + if (regdb_key_exists(add_path)) { + return WERR_OK; + } + if (regdb->transaction_start(regdb) != 0) { DEBUG(0, ("init_registry_key: transaction_start failed\n")); return WERR_REG_IO_FAILURE;