diff mbox series

rt-migrate: Use int instead of pthread_t for thread IDs

Message ID 20220824062542.1695530-1-raj.khem@gmail.com
State Accepted
Headers show
Series rt-migrate: Use int instead of pthread_t for thread IDs | expand

Commit Message

Khem Raj Aug. 24, 2022, 6:25 a.m. UTC
pthread_t is opaque, but create_fifo_thread() returns integer therefore
on musl where thread_t is not integer, this fails to compile e.g.

| rt-migrate.c:450:14: error: incompatible integer to pointer conversion assigning to 'pthread_t' (aka 'struct __pthread *') from 'int' [-Wint-conversion]
|                 threads[i] = create_fifo_thread(start_task, (void *)i,
|                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Align the types used to fix the problems.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 testcases/realtime/func/rt-migrate/rt-migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Cyril Hrubis Aug. 24, 2022, 8:31 a.m. UTC | #1
Hi!
Applied, thanks.
diff mbox series

Patch

diff --git a/testcases/realtime/func/rt-migrate/rt-migrate.c b/testcases/realtime/func/rt-migrate/rt-migrate.c
index 3e6c82a2f..97ab604c7 100644
--- a/testcases/realtime/func/rt-migrate/rt-migrate.c
+++ b/testcases/realtime/func/rt-migrate/rt-migrate.c
@@ -394,7 +394,7 @@  static void stop_log(int sig)
 
 int main(int argc, char **argv)
 {
-	pthread_t *threads;
+	int *threads;
 	long i;
 	int ret;
 	struct timespec intv;