The function strerror() is insecure in a multi-thread environment.
This patch uses rte_strerror() to replace it.

Cc: sta...@dpdk.org

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

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;
        }
 
-- 
2.33.0

Reply via email to