diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2015-03-23 09:15:51 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2015-06-12 15:59:39 +0200 |
commit | d385a2a57a759981321b8ce01506e1aa6d2a67c4 (patch) | |
tree | 6e60bb9ce80fb81cde458ed8faeb982d62d64804 /src/settings/plugins/ifnet/net_utils.c | |
parent | 6c3d71c431ef63005f9005e68ff49b21b153ee9f (diff) | |
download | NetworkManager-d385a2a57a759981321b8ce01506e1aa6d2a67c4.tar.gz |
settings: remove hostname handling from plugins
Remove all hostname-related code from plugins since this functionality
has been moved to the core.
Diffstat (limited to 'src/settings/plugins/ifnet/net_utils.c')
-rw-r--r-- | src/settings/plugins/ifnet/net_utils.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/settings/plugins/ifnet/net_utils.c b/src/settings/plugins/ifnet/net_utils.c index adb23c43f4..81d73807ab 100644 --- a/src/settings/plugins/ifnet/net_utils.c +++ b/src/settings/plugins/ifnet/net_utils.c @@ -136,47 +136,6 @@ reload_parsers (void) return TRUE; } -gchar * -read_hostname (const char *path) -{ - gchar *contents = NULL, *result = NULL, *tmp; - gchar **all_lines = NULL; - guint line_num, i; - - if (!g_file_get_contents (path, &contents, NULL, NULL)) - return NULL; - all_lines = g_strsplit (contents, "\n", 0); - line_num = g_strv_length (all_lines); - for (i = 0; i < line_num; i++) { - g_strstrip (all_lines[i]); - if (all_lines[i][0] == '#' || all_lines[i][0] == '\0') - continue; - if (g_str_has_prefix (all_lines[i], "hostname")) { - tmp = strstr (all_lines[i], "="); - tmp++; - result = g_shell_unquote (tmp, NULL); - break; - } - - } - g_strfreev (all_lines); - g_free (contents); - return result; -} - -gboolean -write_hostname (const char *path, const gchar *hostname) -{ - gboolean result; - char *contents; - - contents = g_strdup_printf ("#Generated by NetworkManager\n" - "hostname=\"%s\"\n", hostname); - result = g_file_set_contents (path, contents, -1, NULL); - g_free (contents); - return result; -} - gboolean is_static_ip4 (const char *conn_name) { |