[dpdk-dev] eal/linux: fix build with glibc < 2.12

Message ID 1466370670-20981-1-git-send-email-thomas.monjalon@6wind.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Thomas Monjalon June 19, 2016, 9:11 p.m. UTC
  The function rte_thread_setname needs glibc 2.12,
otherwise it returns -1 without using any parameter.
The macro RTE_SET_USED avoids an "unused parameter" warning.

Fixes: 3901ed99c2f8 ("eal: fix thread naming on FreeBSD")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 lib/librte_eal/linuxapp/eal/eal_thread.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Thomas Monjalon June 20, 2016, 8:51 a.m. UTC | #1
2016-06-19 23:11, Thomas Monjalon:
> The function rte_thread_setname needs glibc 2.12,
> otherwise it returns -1 without using any parameter.
> The macro RTE_SET_USED avoids an "unused parameter" warning.
> 
> Fixes: 3901ed99c2f8 ("eal: fix thread naming on FreeBSD")
> 
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Applied
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal_thread.c b/lib/librte_eal/linuxapp/eal/eal_thread.c
index 8c3bf03..9f88530 100644
--- a/lib/librte_eal/linuxapp/eal/eal_thread.c
+++ b/lib/librte_eal/linuxapp/eal/eal_thread.c
@@ -206,5 +206,7 @@  int rte_thread_setname(pthread_t id, const char *name)
 	ret = pthread_setname_np(id, name);
 #endif
 #endif
+	RTE_SET_USED(id);
+	RTE_SET_USED(name);
 	return ret;
 }