From: Volker Lendecke Date: Tue, 14 Aug 2018 11:52:11 +0000 (+0200) Subject: torture3: Simplify the g_lock6 test X-Git-Tag: tdb-1.3.17~2121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc41281e4fe6f71692678a63a3287f25ba4787f3;p=thirdparty%2Fsamba.git torture3: Simplify the g_lock6 test Do string_term_tdb_data just once, this is a leftover from a sweeping change from "char *" to TDB_DATA as g_lock key. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13195 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- diff --git a/source3/torture/test_g_lock.c b/source3/torture/test_g_lock.c index 43e699fb173..ed1cd180f54 100644 --- a/source3/torture/test_g_lock.c +++ b/source3/torture/test_g_lock.c @@ -730,7 +730,7 @@ bool run_g_lock6(int dummy) struct tevent_context *ev = NULL; struct messaging_context *msg = NULL; struct g_lock_ctx *ctx = NULL; - const char *lockname = "lock6"; + TDB_DATA lockname = string_term_tdb_data("lock6"); pid_t child; int exit_pipe[2], ready_pipe[2]; NTSTATUS status; @@ -780,7 +780,7 @@ bool run_g_lock6(int dummy) exit(1); } status = g_lock_lock(ctx, - string_term_tdb_data(lockname), + lockname, G_LOCK_READ, (struct timeval) { .tv_sec = 1 }); if (!NT_STATUS_IS_OK(status)) { @@ -824,8 +824,7 @@ bool run_g_lock6(int dummy) { struct lock6_parser_state state; - status = g_lock_dump(ctx, string_term_tdb_data(lockname), - lock6_parser, &state); + status = g_lock_dump(ctx, lockname, lock6_parser, &state); if (!NT_STATUS_IS_OK(status)) { fprintf(stderr, "g_lock_dump returned %s\n", nt_errstr(status)); @@ -838,7 +837,8 @@ bool run_g_lock6(int dummy) return false; } - status = g_lock_lock(ctx, string_term_tdb_data(lockname), + status = g_lock_lock(ctx, + lockname, G_LOCK_WRITE, (struct timeval) { .tv_sec = 1 }); if (!NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {