registry: check for existence of key init_registry_key and possibly save a write.
authorMichael Adam <obnox@samba.org>
Tue, 29 Apr 2008 15:18:26 +0000 (17:18 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 30 Apr 2008 10:42:32 +0000 (12:42 +0200)
Michael
(This used to be commit 3ab5a2f1b3cf37c380ff3e45a957e62a8017814a)

source3/registry/reg_backend_db.c

index 33454c9064554f45833c8e915f98a036de280389..e10cfb520badb8a171aded056611bf9cb53f5b67 100644 (file)
@@ -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;