[SCM] Samba Shared Repository - branch master updated
Ralph Böhme
slow at samba.org
Thu Jul 23 12:40:05 UTC 2015
The branch, master has been updated
via 5f8bad2 tdb_wrap: Use a struct initializer
via 28e4616 tdb_wrap: Use talloc_pooled_object
from 00ec3c4 ctdb-daemon: Correctly process the exit code from failed eventscripts
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 5f8bad2fe7bf2887ef04a73f109b59b6aa0ddb53
Author: Volker Lendecke <vl at samba.org>
Date: Sun Jul 12 12:45:33 2015 +0200
tdb_wrap: Use a struct initializer
... this saves 3 lines a few bytes .text :-)
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Thu Jul 23 14:39:18 CEST 2015 on sn-devel-104
commit 28e4616e2094e9f3866547481b68e198892a409b
Author: Volker Lendecke <vl at samba.org>
Date: Sun Jul 12 12:37:43 2015 +0200
tdb_wrap: Use talloc_pooled_object
One malloc() less
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
-----------------------------------------------------------------------
Summary of changes:
lib/tdb_wrap/tdb_wrap.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/tdb_wrap/tdb_wrap.c b/lib/tdb_wrap/tdb_wrap.c
index a1bddf3..864656f 100644
--- a/lib/tdb_wrap/tdb_wrap.c
+++ b/lib/tdb_wrap/tdb_wrap.c
@@ -90,19 +90,15 @@ 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(mem_ctx, struct tdb_wrap_private);
+ result = talloc_pooled_object(mem_ctx, struct tdb_wrap_private,
+ 1, strlen(name)+1);
if (result == NULL) {
return NULL;
}
+ /* Doesn't fail, see talloc_pooled_object */
result->name = talloc_strdup(result, name);
- if (result->name == NULL) {
- goto fail;
- }
-
- 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);
--
Samba Shared Repository
More information about the samba-cvs
mailing list