tdb_wrap: Use a struct initializer
authorVolker Lendecke <vl@samba.org>
Sun, 12 Jul 2015 10:45:33 +0000 (12:45 +0200)
committerRalph Böhme <slow@samba.org>
Thu, 23 Jul 2015 12:39:18 +0000 (14:39 +0200)
... this saves 3 lines a few bytes .text :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jul 23 14:39:18 CEST 2015 on sn-devel-104

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) {