mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:17 +00:00
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: 215235d365
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>
This commit is contained in:
committed by
Thomas Huth
parent
7dfea705cb
commit
b8c2426157
@@ -568,7 +568,8 @@ const char *qemu_thread_get_name(void)
|
||||
# if defined(CONFIG_PTHREAD_GETNAME_NP)
|
||||
rv = pthread_getname_np(pthread_self(), namebuf, sizeof(namebuf));
|
||||
# elif defined(CONFIG_PTHREAD_GET_NAME_NP)
|
||||
rv = pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf));
|
||||
pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf));
|
||||
rv = 0;
|
||||
# else
|
||||
rv = -1;
|
||||
# endif
|
||||
|
||||
Reference in New Issue
Block a user