2005-12-13 Robert Love <rml@novell.com>
* src/named-manager/nm-named-manager.c: Revert earlier commit. Instead, fail silently if config is NULL by not asserting and not returning FALSE. Also, make sure we always fclose() the file. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1180 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2005-12-13 Robert Love <rml@novell.com>
|
||||||
|
|
||||||
|
* src/named-manager/nm-named-manager.c: Revert earlier commit. Instead, fail silently if config is NULL
|
||||||
|
by not asserting and not returning FALSE. Also, make sure we always fclose() the file.
|
||||||
|
|
||||||
2005-12-13 Robert Love <rml@novell.com>
|
2005-12-13 Robert Love <rml@novell.com>
|
||||||
|
|
||||||
Patch by Stefan Scheler <sscheler@suse.de>:
|
Patch by Stefan Scheler <sscheler@suse.de>:
|
||||||
|
@@ -354,7 +354,9 @@ rewrite_resolv_conf (NMNamedManager *mgr, NMIP4Config *config, GError **error)
|
|||||||
char * searches = NULL;
|
char * searches = NULL;
|
||||||
FILE * f;
|
FILE * f;
|
||||||
|
|
||||||
g_return_val_if_fail (config != NULL, FALSE);
|
/* If no config, we don't have anything to update, so exit silently */
|
||||||
|
if (!config)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
if ((f = fopen (tmp_resolv_conf, "w")) == NULL)
|
if ((f = fopen (tmp_resolv_conf, "w")) == NULL)
|
||||||
goto lose;
|
goto lose;
|
||||||
@@ -390,8 +392,9 @@ rewrite_resolv_conf (NMNamedManager *mgr, NMIP4Config *config, GError **error)
|
|||||||
nm_system_update_dns ();
|
nm_system_update_dns ();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
lose:
|
lose:
|
||||||
g_free (searches);
|
g_free (searches);
|
||||||
|
fclose (f);
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
NM_NAMED_MANAGER_ERROR,
|
NM_NAMED_MANAGER_ERROR,
|
||||||
NM_NAMED_MANAGER_ERROR_SYSTEM,
|
NM_NAMED_MANAGER_ERROR_SYSTEM,
|
||||||
@@ -706,6 +709,9 @@ nm_named_manager_remove_ip4_config (NMNamedManager *mgr, NMIP4Config *config)
|
|||||||
if (mgr->priv->use_named)
|
if (mgr->priv->use_named)
|
||||||
remove_ip4_config_from_named (mgr, config);
|
remove_ip4_config_from_named (mgr, config);
|
||||||
|
|
||||||
|
mgr->priv->configs = g_slist_remove (mgr->priv->configs, config);
|
||||||
|
nm_ip4_config_unref (config);
|
||||||
|
|
||||||
/* Clear out and reload configs since we may need a new
|
/* Clear out and reload configs since we may need a new
|
||||||
* default zone if the one we are removing was the old
|
* default zone if the one we are removing was the old
|
||||||
* default zone.
|
* default zone.
|
||||||
@@ -723,9 +729,6 @@ nm_named_manager_remove_ip4_config (NMNamedManager *mgr, NMIP4Config *config)
|
|||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
mgr->priv->configs = g_slist_remove (mgr->priv->configs, config);
|
|
||||||
nm_ip4_config_unref (config);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user