blob: e49f53a9e2e442cb80dc79dafa1dbd27084fac3e [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 11e503344c36c1c7df3e455d81736dc4a5b43775 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 23 Aug 2022 23:20:53 -0700
4Subject: [PATCH] rt-migrate: Use int instead of pthread_t for thread IDs
5
6pthread_t is opaque, but create_fifo_thread() returns integer therefore
7on musl where thread_t is not integer, this fails to compile e.g.
8
9| rt-migrate.c:450:14: error: incompatible integer to pointer conversion assigning to 'pthread_t' (aka 'struct __pthread *') from 'int' [-Wint-conversion]
10| threads[i] = create_fifo_thread(start_task, (void *)i,
11| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12
13Align the types used to fix the problems.
14
15Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2022-August/030239.html]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 testcases/realtime/func/rt-migrate/rt-migrate.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/testcases/realtime/func/rt-migrate/rt-migrate.c b/testcases/realtime/func/rt-migrate/rt-migrate.c
22index 3e6c82a2fb..97ab604c7f 100644
23--- a/testcases/realtime/func/rt-migrate/rt-migrate.c
24+++ b/testcases/realtime/func/rt-migrate/rt-migrate.c
25@@ -394,7 +394,7 @@ static void stop_log(int sig)
26
27 int main(int argc, char **argv)
28 {
29- pthread_t *threads;
30+ int *threads;
31 long i;
32 int ret;
33 struct timespec intv;
34--
352.37.2
36