logging: make _nm_logging_clear_platform_logging_cache() a regular function

Previously, _nm_logging_clear_platform_logging_cache was an extern variable,
and NMLinuxPlatform would set it to a function pointer at certain points.

That's unnecessary complex, also when trying to make nm-logging thread-safe,
it's just more global variables that need to be considered. Don't do it
that way, but just link in a regular function.
This commit is contained in:
Thomas Haller
2019-01-15 16:41:57 +01:00
parent 40b0d7ce1e
commit ba1bf0390d
3 changed files with 6 additions and 8 deletions

View File

@@ -4146,8 +4146,8 @@ sysctl_set (NMPlatform *platform, const char *pathid, int dirfd, const char *pat
static GSList *sysctl_clear_cache_list;
static void
_nm_logging_clear_platform_logging_cache_impl (void)
void
_nm_logging_clear_platform_logging_cache (void)
{
while (sysctl_clear_cache_list) {
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (sysctl_clear_cache_list->data);
@@ -4167,7 +4167,6 @@ _log_dbg_sysctl_get_impl (NMPlatform *platform, const char *pathid, const char *
const char *prev_value = NULL;
if (!priv->sysctl_get_prev_values) {
_nm_logging_clear_platform_logging_cache = _nm_logging_clear_platform_logging_cache_impl;
sysctl_clear_cache_list = g_slist_prepend (sysctl_clear_cache_list, platform);
priv->sysctl_get_prev_values = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free);
} else