[PATCH] virthreadpthread: don't try to cast pthread_t to void*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes the build on kFreeBSD that otherwise fails with:

util/virthreadpthread.c: In function 'virThreadSelfID':
util/virthreadpthread.c:222:27: error: cast from function call of type 'pthread_t' to non-matching type 'void *' [-Werror=bad-function-cast]
---
I'm unsure why we'd need the cast to (void*) first.
 -- Guido

 src/util/virthreadpthread.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virthreadpthread.c b/src/util/virthreadpthread.c
index b42b333..8d5e197 100644
--- a/src/util/virthreadpthread.c
+++ b/src/util/virthreadpthread.c
@@ -219,7 +219,7 @@ int virThreadSelfID(void)
     tid = syscall(SYS_gettid);
     return (int)tid;
 #else
-    return (int)(intptr_t)(void *)pthread_self();
+    return (int)(intptr_t)pthread_self();
 #endif
 }
 
-- 
1.7.10.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]