]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture3: Parametrize lock4_child()s locktype
authorVolker Lendecke <vl@samba.org>
Sun, 22 Dec 2019 13:01:07 +0000 (14:01 +0100)
committerJeremy Allison <jra@samba.org>
Sun, 22 Dec 2019 17:29:28 +0000 (17:29 +0000)
We'll call it twice soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/test_g_lock.c

index 6a199c503544b1f8da78567c8329c031af102f43..945b32fb8e501418f2df59f2dae7802e9285a75a 100644 (file)
@@ -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);
        }