From 2969258cb41064d2295ac823f385ad41ef405f15 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 8 Dec 2017 11:20:13 +0100 Subject: [PATCH] pdump: fix error check when creating/canceling thread On error, pthread_create() returns a positive number (an errno) but does not set the errno variable. Fixes: 278f945402c5 ("pdump: add new library for packet capture") Cc: stable@dpdk.org Signed-off-by: Olivier Matz Acked-by: John McNamara --- lib/librte_pdump/rte_pdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index ba43d14255..ec8a5d84cf 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -552,7 +552,7 @@ rte_pdump_init(const char *path) if (ret != 0) { RTE_LOG(ERR, PDUMP, "Failed to create the pdump thread:%s, %s:%d\n", - strerror(errno), __func__, __LINE__); + strerror(ret), __func__, __LINE__); return -1; } /* Set thread_name for aid in debugging. */ @@ -575,7 +575,7 @@ rte_pdump_uninit(void) if (ret != 0) { RTE_LOG(ERR, PDUMP, "Failed to cancel the pdump thread:%s, %s:%d\n", - strerror(errno), __func__, __LINE__); + strerror(ret), __func__, __LINE__); return -1; } -- 2.20.1