systemd: define strerror() in sd-adapt header to nm_strerror_native()

Systemd uses strerror() extensively. Patch the function to use the thread-safe
nm_strerror_native().
This commit is contained in:
Thomas Haller
2019-01-31 12:56:07 +01:00
parent 9beed4f661
commit 2b630bc22e
2 changed files with 11 additions and 0 deletions

View File

@@ -27,6 +27,11 @@
/*****************************************************************************/ /*****************************************************************************/
/* strerror() is not thread-safe. Patch systemd-sources via a define. */
#define strerror(errsv) nm_strerror_native (errsv)
/*****************************************************************************/
static inline NMLogLevel static inline NMLogLevel
_slog_level_to_nm (int slevel) _slog_level_to_nm (int slevel)
{ {

View File

@@ -80,6 +80,12 @@ nm_logging_setup (const char *level,
return TRUE; return TRUE;
} }
const char *
nm_strerror_native (int errsv)
{
return g_strerror (errsv);
}
/*****************************************************************************/ /*****************************************************************************/
static void static void