From: Volker Lendecke Date: Sun, 22 Dec 2019 13:01:07 +0000 (+0100) Subject: torture3: Parametrize lock4_child()s locktype X-Git-Tag: ldb-2.1.0~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc00eaca703be97709d0706f746930b3a13bb44b;p=thirdparty%2Fsamba.git torture3: Parametrize lock4_child()s locktype We'll call it twice soon Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/torture/test_g_lock.c b/source3/torture/test_g_lock.c index 6a199c50354..945b32fb8e5 100644 --- a/source3/torture/test_g_lock.c +++ b/source3/torture/test_g_lock.c @@ -333,7 +333,9 @@ fail: } static bool lock4_child(const char *lockname, - int ready_pipe, int exit_pipe) + enum g_lock_type lock_type, + int ready_pipe, + int exit_pipe) { struct tevent_context *ev = NULL; struct messaging_context *msg = NULL; @@ -347,8 +349,11 @@ static bool lock4_child(const char *lockname, return false; } - status = g_lock_lock(ctx, string_term_tdb_data(lockname), G_LOCK_WRITE, - (struct timeval) { .tv_sec = 1 }); + status = g_lock_lock( + ctx, + string_term_tdb_data(lockname), + lock_type, + (struct timeval) { .tv_sec = 1 }); if (!NT_STATUS_IS_OK(status)) { fprintf(stderr, "child: g_lock_lock returned %s\n", nt_errstr(status)); @@ -485,7 +490,8 @@ bool run_g_lock4(int dummy) if (child == 0) { close(ready_pipe[0]); close(exit_pipe[1]); - ok = lock4_child(lockname, ready_pipe[1], exit_pipe[0]); + ok = lock4_child( + lockname, G_LOCK_WRITE, ready_pipe[1], exit_pipe[0]); exit(ok ? 0 : 1); }