[v4,06/42] pdump: use rte strerror

Message ID 20241023082852.2780488-7-huangdengdui@huawei.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers
Series replace strerror |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

huangdengdui Oct. 23, 2024, 8:28 a.m. UTC
The function strerror() is insecure in a multi-thread environment.
This patch uses rte_strerror() to replace it.

Cc: stable@dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/pdump/rte_pdump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 679c3dd0b5..ebf6498b82 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -337,7 +337,7 @@  set_pdump_rxtx_cbs(const struct pdump_request *p)
 		if (ret != 0) {
 			PDUMP_LOG_LINE(ERR,
 				"Error during getting device (port %u) info: %s",
-				port, strerror(-ret));
+				port, rte_strerror(-ret));
 			return ret;
 		}
 
@@ -407,7 +407,7 @@  pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 	mp_resp.num_fds = 0;
 	if (rte_mp_reply(&mp_resp, peer) < 0) {
 		PDUMP_LOG_LINE(ERR, "failed to send to client:%s",
-			  strerror(rte_errno));
+			  rte_strerror(rte_errno));
 		return -1;
 	}
 
@@ -739,7 +739,7 @@  rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
 	if (ret != 0) {
 		PDUMP_LOG_LINE(ERR,
 			  "Error during getting device (port %u) info: %s",
-			  port, strerror(-ret));
+			  port, rte_strerror(-ret));
 		return ret;
 	}