diff options
author | Andreas Schneider <asn@samba.org> | 2018-05-09 17:52:19 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-06-20 09:22:24 +0200 |
commit | 05dab794c2f15701f5ecb3909e4fa714b74c16c8 (patch) | |
tree | 25c9e05e21823746b08f02451e52add13e62e014 /lib | |
parent | ca1acededa6905927c7768e1a33bee5358013ebe (diff) | |
download | samba-05dab794c2f15701f5ecb3909e4fa714b74c16c8.tar.gz |
lib:util: Fix parameter aliasing in tfork test
../lib/util/tests/tfork.c:483:24: error: passing argument 1 to
restrict-qualified parameter aliases with argument 4 [-Werror=restrict]
ret = pthread_create(&threads[i],
^~~~~~~~~~~
../lib/util/tests/tfork.c:486:10:
(void *)&threads[i]);
~~~~~~~~~~~~~~~~~~~
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 6f06a0154f5769cb85f6e189eecd78cd7805090a)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util/tests/tfork.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/util/tests/tfork.c b/lib/util/tests/tfork.c index 9bcdc2f3d6d..3c73355b3f0 100644 --- a/lib/util/tests/tfork.c +++ b/lib/util/tests/tfork.c @@ -417,8 +417,7 @@ static void *tfork_thread(void *p) struct tfork *t = NULL; int status; pid_t child; - pthread_t *ptid = (pthread_t *)p; - uint64_t tid; + uint64_t tid = (uint64_t)pthread_self(); uint64_t *result = NULL; int up[2]; ssize_t nread; @@ -429,8 +428,6 @@ static void *tfork_thread(void *p) pthread_exit(NULL); } - tid = (uint64_t)*ptid; - t = tfork_create(); if (t == NULL) { pthread_exit(NULL); @@ -480,7 +477,7 @@ static bool test_tfork_threads(struct torture_context *tctx) #endif for (i = 0; i < num_threads; i++) { - ret = pthread_create(&threads[i], NULL, tfork_thread, &threads[i]); + ret = pthread_create(&threads[i], NULL, tfork_thread, NULL); torture_assert_goto(tctx, ret == 0, ok, done, "pthread_create failed\n"); } |