pdump: fix error code check when creating/canceling pthread
PATCH 1/1 pdump: fix error code check when creating/canceling pthread
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")
Signed-off-by Olivier Matz <[email protected]>
--- lib/librte_pdump/rte_pdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_pdump/rte_pdump.c +2 -2
@@ -581,7 +581,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. */
@@ -604,7 +604,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 ; }
Signature · 1 line
2.11.0
Quoted 10 lines
-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of Olivier Matz
Sent: Friday, December 8, 2017 10:20 AM
To: [email protected]; Pattan, Reshma <[email protected]>
Cc: [email protected]
Subject: [dpdk-stable] [PATCH] pdump: fix error code check when creating/canceling pthread
Quoted 7 lines
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")Signed-off-by Olivier Matz <[email protected]>
Acked-by John McNamara <[email protected]>
Thomas Monjalon
AppliedQuoted 9 lines
Quoted 7 lines
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")Signed-off-by Olivier Matz <[email protected]>Acked-by John McNamara <[email protected]>
Applied, thanks