91e475acee
git-svn-id: http://svn.sabayonlinux.org/overlay@1071 d7aec97c-591d-0410-af39-a8856400b30a
42 lines
1.2 KiB
Diff
42 lines
1.2 KiB
Diff
diff -Nurp NetworkManager.orig/src/backends/NetworkManagerGentoo.c NetworkManager/src/backends/NetworkManagerGentoo.c
|
|
--- NetworkManager.orig/src/backends/NetworkManagerGentoo.c 2007-03-08 18:59:55.000000000 +0100
|
|
+++ NetworkManager/src/backends/NetworkManagerGentoo.c 2007-03-08 19:08:52.000000000 +0100
|
|
@@ -890,37 +890,6 @@ void nm_system_shutdown_nis (void)
|
|
*/
|
|
void nm_system_set_hostname (NMIP4Config *config)
|
|
{
|
|
- char *h_name = NULL;
|
|
- const char *hostname;
|
|
-
|
|
- g_return_if_fail (config != NULL);
|
|
-
|
|
- hostname = nm_ip4_config_get_hostname (config);
|
|
- if (!hostname)
|
|
- {
|
|
- struct in_addr temp_addr;
|
|
- struct hostent *host;
|
|
-
|
|
- /* try to get hostname via dns */
|
|
- temp_addr.s_addr = nm_ip4_config_get_address (config);
|
|
- host = gethostbyaddr ((char *) &temp_addr, sizeof (temp_addr), AF_INET);
|
|
- if (host)
|
|
- {
|
|
- h_name = g_strdup (host->h_name);
|
|
- hostname = strtok (h_name, ".");
|
|
- }
|
|
- else
|
|
- nm_warning ("nm_system_set_hostname(): gethostbyaddr failed, h_errno = %d", h_errno);
|
|
- }
|
|
-
|
|
- if (hostname)
|
|
- {
|
|
- nm_info ("Setting hostname to '%s'", hostname);
|
|
- if (sethostname (hostname, strlen (hostname)) < 0)
|
|
- nm_warning ("Could not set hostname.");
|
|
- }
|
|
-
|
|
- g_free (h_name);
|
|
}
|
|
|
|
/*
|