summaryrefslogtreecommitdiff
path: root/src/platform/nm-linux-platform.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-03-01 10:17:44 +0100
committerThomas Haller <thaller@redhat.com>2016-03-01 12:42:42 +0100
commite4a7502a2c85a09f7eceeff34ad47ac5f0e01e67 (patch)
tree502232ceb3155fd23b32773baa2aafe4405e9d2b /src/platform/nm-linux-platform.c
parent60ca6e028f2d3be8718e069d762504c3104a2d3a (diff)
downloadNetworkManager-e4a7502a2c85a09f7eceeff34ad47ac5f0e01e67.tar.gz
logging: make logging independent of platform
"nm-logging.h" is a basic core module that should have few other dependencies. Instead of letting nm-logging.c directly call a function from "nm-linux-platform.c", let platform register a handler as needed. This way, you can build a core library containing nm-logging but no nm-platform.
Diffstat (limited to 'src/platform/nm-linux-platform.c')
-rw-r--r--src/platform/nm-linux-platform.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index b3a8c4aa73..637012c69c 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -2520,8 +2520,8 @@ sysctl_set (NMPlatform *platform, const char *path, const char *value)
static GSList *sysctl_clear_cache_list;
-void
-_nm_linux_platform_sysctl_clear_cache (void)
+static void
+_nm_logging_clear_platform_logging_cache_impl (void)
{
while (sysctl_clear_cache_list) {
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (sysctl_clear_cache_list->data);
@@ -2541,6 +2541,7 @@ _log_dbg_sysctl_get_impl (NMPlatform *platform, const char *path, const char *co
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 (g_str_hash, g_str_equal, g_free, g_free);
} else