2008-09-12 Tambet Ingo <tambet@gmail.com>

* src/named-manager/nm-named-manager.c (dispatch_netconfig): Make it compile
	again. Add some debugging.

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4060 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Tambet Ingo 2008-09-12 11:22:06 +00:00
parent d8c3e8e7fd
commit 2f5ed47908
2 changed files with 23 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2008-09-12 Tambet Ingo <tambet@gmail.com>
* src/named-manager/nm-named-manager.c (dispatch_netconfig): Make it compile
again. Add some debugging.
2008-09-11 Dan Williams <dcbw@redhat.com>
* system-settings/plugins/keyfile/plugin.c

View file

@ -135,6 +135,7 @@ static gint
run_netconfig (GError **error)
{
char *argv[5];
char *tmp;
gint stdin_fd;
argv[0] = "/sbin/netconfig";
@ -143,6 +144,10 @@ run_netconfig (GError **error)
argv[3] = "NetworkManager";
argv[4] = NULL;
tmp = g_strjoinv (" ", argv);
nm_debug ("Spawning '%s'", tmp);
g_free (tmp);
if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, netconfig_child_setup,
NULL, NULL, &stdin_fd, NULL, NULL, error))
return -1;
@ -157,12 +162,14 @@ write_to_netconfig (gint fd, const char *key, const char *value)
int x;
str = g_strdup_printf ("%s='%s'\n", key, value);
nm_debug ("Writing to netconfig: %s", str);
x = write (fd, str, strlen (str));
g_free (str);
}
static gboolean
dispatch_netconfig (char **searches,
dispatch_netconfig (const char *domain,
char **searches,
char **nameservers,
const char *iface,
GError **error)
@ -178,7 +185,16 @@ dispatch_netconfig (char **searches,
if (searches) {
str = g_strjoinv (" ", searches);
write_to_netconfig (fd, "DNSDOMAIN", str);
if (domain) {
char *tmp;
tmp = g_strconcat (domain, " ", str, NULL);
g_free (str);
str = tmp;
}
write_to_netconfig (fd, "DNSSEARCH", str);
g_free (str);
}