From: Jan Kiszka Date: Tue, 11 Mar 2014 15:49:23 +0000 (+0100) Subject: qemu-thread-posix: Fix build against older glibc version X-Git-Tag: v2.0.0-rc0~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01207d0b78208c2f49c3f457d6794eea215d5be7;p=thirdparty%2Fqemu.git qemu-thread-posix: Fix build against older glibc version pthread_setname_np was introduced with 2.12. Signed-off-by: Jan Kiszka Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Maydell --- diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 45113b464d7..960d7f5d428 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -420,7 +420,7 @@ void qemu_thread_create(QemuThread *thread, const char *name, if (err) error_exit(err, __func__); -#ifdef _GNU_SOURCE +#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) if (name_threads) { pthread_setname_np(thread->thread, name); }