[v4,04/42] latency: use rte strerror

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

Patch

diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c
index 6a261309f9..1ae95a52ae 100644
--- a/lib/latencystats/rte_latencystats.c
+++ b/lib/latencystats/rte_latencystats.c
@@ -268,7 +268,7 @@  rte_latencystats_init(uint64_t app_samp_intvl,
 		if (ret != 0) {
 			LATENCY_STATS_LOG(INFO,
 				"Error during getting device (port %u) info: %s",
-				pid, strerror(-ret));
+				pid, rte_strerror(-ret));
 
 			continue;
 		}
@@ -312,7 +312,7 @@  rte_latencystats_uninit(void)
 		if (ret != 0) {
 			LATENCY_STATS_LOG(INFO,
 				"Error during getting device (port %u) info: %s",
-				pid, strerror(-ret));
+				pid, rte_strerror(-ret));
 
 			continue;
 		}