tdb_wrap: Use a struct initializer
[vlendec/samba-autobuild/.git] / lib / tdb_wrap / tdb_wrap.c
index 04f8d4806633e620cb99873a99c641b174323d1c..864656f204768d149d4c16e76c2cc9ae8af13078 100644 (file)
@@ -90,7 +90,7 @@ static struct tdb_wrap_private *tdb_wrap_private_open(TALLOC_CTX *mem_ctx,
                                                      mode_t mode)
 {
        struct tdb_wrap_private *result;
-       struct tdb_logging_context lctx;
+       struct tdb_logging_context lctx = { .log_fn = tdb_wrap_log };
 
        result = talloc_pooled_object(mem_ctx, struct tdb_wrap_private,
                                      1, strlen(name)+1);
@@ -100,9 +100,6 @@ static struct tdb_wrap_private *tdb_wrap_private_open(TALLOC_CTX *mem_ctx,
        /* Doesn't fail, see talloc_pooled_object */
        result->name = talloc_strdup(result, name);
 
-       lctx.log_fn = tdb_wrap_log;
-       lctx.log_private = NULL;
-
        result->tdb = tdb_open_ex(name, hash_size, tdb_flags,
                                  open_flags, mode, &lctx, NULL);
        if (result->tdb == NULL) {