1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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 <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Volker Lendecke 2018-08-14 13:52:11 +02:00
parent b0130fe4a8
commit fc41281e4f

View File

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