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(-)
@@ -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;
}