From 04edba879de2366001bf02541ab78c9a8c8c8ca9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 18 Aug 2023 14:35:05 +0200 Subject: [PATCH] core: use nm_strerror_native() instead of strerror() strerror() is not thread-safe. We avoid non-thread-safe API and have instead our own wrapper nm_strerror_native(). Use it. --- src/core/devices/wifi/nm-iwd-manager.c | 4 ++-- src/core/dhcp/nm-dhcp-dhcpcd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/devices/wifi/nm-iwd-manager.c b/src/core/devices/wifi/nm-iwd-manager.c index 0d4daf215f..33efa85a61 100644 --- a/src/core/devices/wifi/nm-iwd-manager.c +++ b/src/core/devices/wifi/nm-iwd-manager.c @@ -810,7 +810,7 @@ sett_conn_changed(NMSettingsConnection *sett_conn, nm_log_dbg(LOGD_WIFI, "iwd: profile at %s not removed: %s (%i)", orig_full_path, - strerror(errno), + nm_strerror_native(errno), errno); removed = TRUE; @@ -1431,7 +1431,7 @@ try_delete_file: if (g_remove(full_path) == 0) _LOGD("IWD profile at %s removed", full_path); else if (errno != ENOENT) - _LOGD("IWD profile at %s not removed: %s (%i)", full_path, strerror(errno), errno); + _LOGD("IWD profile at %s not removed: %s (%i)", full_path, nm_strerror_native(errno), errno); } static void diff --git a/src/core/dhcp/nm-dhcp-dhcpcd.c b/src/core/dhcp/nm-dhcp-dhcpcd.c index 8d2f928ba0..7c95994ac6 100644 --- a/src/core/dhcp/nm-dhcp-dhcpcd.c +++ b/src/core/dhcp/nm-dhcp-dhcpcd.c @@ -174,7 +174,7 @@ stop(NMDhcpClient *client, gboolean release) */ if (kill(pid, sig) == -1) { errsv = errno; - _LOGE("failed to kill dhcpcd %d:%s", errsv, strerror(errsv)); + _LOGE("failed to kill dhcpcd %d:%s", errsv, nm_strerror_native(errsv)); } /* When this function exits NM expects the PID to be -1.