util: fix use of pthread_get_name_np on OpenBSD
The pthread_get_name_np function is present on FreeBSD and OpenBSD and has 'void' return not 'int'. We didn't notice this build problem on FreeBSD since it also has pthread_getname_np which does return int like Linux and we use the latter preferentially. Fixes: 215235d365e49c72a85ea2940751e45419676031 Closes: https://gitlab.com/qemu-project/qemu/-/work_items/3399 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260417120531.2215549-1-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Daniel P. Berrangé committed
Apr 17, 2026 at 13:05 UTC
b8c2426157f51391b74251a830371beda43358c9
1 file changed
+2
-1
util/qemu-thread-posix.c
+2
-1
@@ -568,7 +568,8 @@ const char *qemu_thread_get_name(void)
568
# if defined(CONFIG_PTHREAD_GETNAME_NP)
569
rv = pthread_getname_np(pthread_self(), namebuf, sizeof(namebuf));
570
# elif defined(CONFIG_PTHREAD_GET_NAME_NP)
571
- rv = pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf));
571
+ pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf));
572
+ rv = 0;
573
# else
574
rv = -1;
575
# endif