Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame^] | 1 | From 11e503344c36c1c7df3e455d81736dc4a5b43775 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 23 Aug 2022 23:20:53 -0700 |
| 4 | Subject: [PATCH] rt-migrate: Use int instead of pthread_t for thread IDs |
| 5 | |
| 6 | pthread_t is opaque, but create_fifo_thread() returns integer therefore |
| 7 | on 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 | |
| 13 | Align the types used to fix the problems. |
| 14 | |
| 15 | Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2022-August/030239.html] |
| 16 | Signed-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 | |
| 21 | diff --git a/testcases/realtime/func/rt-migrate/rt-migrate.c b/testcases/realtime/func/rt-migrate/rt-migrate.c |
| 22 | index 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 | -- |
| 35 | 2.37.2 |
| 36 | |