From 343a3b724225d3c87af0b268da14d3acb7a5b9a1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 9 May 2021 15:38:43 -0700
Subject: [PATCH] ithread: Use
 pthread_mutexattr_gettype/pthread_mutexattr_settype on linux

_np variants are not recommended anymore, and glibc 2.34+ will have
these removed

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 upnp/inc/ithread.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/upnp/inc/ithread.h b/upnp/inc/ithread.h
index f6800ea9..1d0f9dba 100644
--- a/upnp/inc/ithread.h
+++ b/upnp/inc/ithread.h
@@ -304,7 +304,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void)
  *      Returns EINVAL if the kind is not supported.
  *      See man page for pthread_mutexattr_setkind_np
  *****************************************************************************/
-#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__)
+#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__) \
+    || defined (__linux__)
 	#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
 #else
 	#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
@@ -329,7 +330,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void)
  *      Always returns 0.
  *      See man page for pthread_mutexattr_getkind_np
  *****************************************************************************/
-#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__)
+#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__) \
+    || defined (__linux__)
 	#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
 #else
 	#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
-- 
2.31.1

