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

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dengdui Huang Nov. 14, 2023, 12:35 p.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>
---
 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 80b90c6f7d..7b7b87bbd1 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -340,7 +340,7 @@  set_pdump_rxtx_cbs(const struct pdump_request *p)
 		if (ret != 0) {
 			PDUMP_LOG(ERR,
 				"Error during getting device (port %u) info: %s\n",
-				port, strerror(-ret));
+				port, rte_strerror(-ret));
 			return ret;
 		}
 
@@ -410,7 +410,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(ERR, "failed to send to client:%s\n",
-			  strerror(rte_errno));
+			  rte_strerror(rte_errno));
 		return -1;
 	}
 
@@ -741,7 +741,7 @@  rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
 	if (ret != 0) {
 		PDUMP_LOG(ERR,
 			  "Error during getting device (port %u) info: %s\n",
-			  port, strerror(-ret));
+			  port, rte_strerror(-ret));
 		return ret;
 	}