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>
---
 lib/latencystats/rte_latencystats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/latencystats/rte_latencystats.c 
b/lib/latencystats/rte_latencystats.c
index 8985a377db..a395f9b3bc 100644
--- a/lib/latencystats/rte_latencystats.c
+++ b/lib/latencystats/rte_latencystats.c
@@ -265,7 +265,7 @@ rte_latencystats_init(uint64_t app_samp_intvl,
                if (ret != 0) {
                        RTE_LOG(INFO, LATENCY_STATS,
                                "Error during getting device (port %u) info: 
%s\n",
-                               pid, strerror(-ret));
+                               pid, rte_strerror(-ret));
 
                        continue;
                }
@@ -309,7 +309,7 @@ rte_latencystats_uninit(void)
                if (ret != 0) {
                        RTE_LOG(INFO, LATENCY_STATS,
                                "Error during getting device (port %u) info: 
%s\n",
-                               pid, strerror(-ret));
+                               pid, rte_strerror(-ret));
 
                        continue;
                }
-- 
2.33.0

Reply via email to