summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-04-27 14:14:00 +0200
committerThomas Haller <thaller@redhat.com>2016-04-27 14:51:55 +0200
commitd6e7fa164bed8d4b7255203ba0856dffbc3e4b1f (patch)
tree6931bff6972679cc812f95cf49d8b6a69996cc14
parentc4b88bf23ffa6b906226f4474ff2bfdbd4f033ad (diff)
downloadNetworkManager-d6e7fa164bed8d4b7255203ba0856dffbc3e4b1f.tar.gz
settings: remove unnecessary "file" field for hostname from NMSettingPrivate
-rw-r--r--src/settings/nm-settings.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index f8f3ea857b..304ac2c39e 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -161,7 +161,6 @@ typedef struct {
struct {
char *value;
- char *file;
GFileMonitor *monitor;
GFileMonitor *dhcp_monitor;
gulong monitor_id;
@@ -594,11 +593,11 @@ nm_settings_get_hostname (NMSettings *self)
#endif
#if defined(HOSTNAME_PERSIST_GENTOO)
- hostname = read_hostname_gentoo (priv->hostname.file);
+ hostname = read_hostname_gentoo (HOSTNAME_FILE);
#elif defined(HOSTNAME_PERSIST_SLACKWARE)
- hostname = read_hostname_slackware (priv->hostname.file);
+ hostname = read_hostname_slackware (HOSTNAME_FILE);
#else
- if (g_file_get_contents (priv->hostname.file, &hostname, NULL, NULL))
+ if (g_file_get_contents (HOSTNAME_FILE, &hostname, NULL, NULL))
g_strchomp (hostname);
#endif
@@ -1627,7 +1626,7 @@ write_hostname (NMSettingsPrivate *priv, const char *hostname)
char *hostname_eol;
gboolean ret;
gs_free_error GError *error = NULL;
- const char *file = priv->hostname.file;
+ const char *file = HOSTNAME_FILE;
gs_free char *link_path = NULL;
gs_unref_variant GVariant *var = NULL;
struct stat file_stat;
@@ -2201,11 +2200,10 @@ setup_hostname_file_monitors (NMSettings *self)
GFileMonitor *monitor;
GFile *file;
- priv->hostname.file = HOSTNAME_FILE;
priv->hostname.value = nm_settings_get_hostname (self);
/* monitor changes to hostname file */
- file = g_file_new_for_path (priv->hostname.file);
+ file = g_file_new_for_path (HOSTNAME_FILE);
monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL);
g_object_unref (file);
if (monitor) {