summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-07-03 11:30:26 +0200
committerThomas Haller <thaller@redhat.com>2015-07-12 13:56:52 +0200
commit0dcd7b2208b8b1a5ac0ddf08e18df8c2c35309dd (patch)
treea6e4ec2f6952d3886777c16da9a0e48189dcba7a
parent5b123f2539ec11cd34e75bac7bbfe0738dac0925 (diff)
downloadNetworkManager-0dcd7b2208b8b1a5ac0ddf08e18df8c2c35309dd.tar.gz
settings: refactor logging statement in nm_settings_connection_get_secrets()
-rw-r--r--src/settings/nm-settings-connection.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c
index fae0f025db..a1954bcac4 100644
--- a/src/settings/nm-settings-connection.c
+++ b/src/settings/nm-settings-connection.c
@@ -38,6 +38,7 @@
#include "nm-properties-changed-signal.h"
#include "nm-core-internal.h"
#include "nm-glib-compat.h"
+#include "gsystem-local-alloc.h"
#define SETTINGS_TIMESTAMPS_FILE NMSTATEDIR "/timestamps"
#define SETTINGS_SEEN_BSSIDS_FILE NMSTATEDIR "/seen-bssids"
@@ -938,7 +939,7 @@ nm_settings_connection_get_secrets (NMSettingsConnection *self,
GVariant *existing_secrets;
GHashTable *existing_secrets_hash;
guint32 call_id = 0;
- char *joined_hints = NULL;
+ gs_free char *joined_hints = NULL;
/* Use priv->secrets to work around the fact that nm_connection_clear_secrets()
* will clear secrets on this object's settings.
@@ -976,17 +977,12 @@ nm_settings_connection_get_secrets (NMSettingsConnection *self,
if (existing_secrets)
g_variant_unref (existing_secrets);
- if (nm_logging_enabled (LOGL_DEBUG, LOGD_SETTINGS)) {
- if (hints)
- joined_hints = g_strjoinv (",", (char **) hints);
- nm_log_dbg (LOGD_SETTINGS, "(%s/%s:%u) secrets requested flags 0x%X hints '%s'",
- nm_connection_get_uuid (NM_CONNECTION (self)),
- setting_name,
- call_id,
- flags,
- joined_hints ? joined_hints : "(none)");
- g_free (joined_hints);
- }
+ nm_log_dbg (LOGD_SETTINGS, "(%s/%s:%u) secrets requested flags 0x%X hints '%s'",
+ nm_connection_get_uuid (NM_CONNECTION (self)),
+ setting_name,
+ call_id,
+ flags,
+ (hints && hints[0]) ? (joined_hints = g_strjoinv (",", (char **) hints)) : "(none)");
return call_id;
}