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:
Robert Love
2005-12-13 21:45:52 +00:00
committed by Robert Love
parent 4be49b9902
commit bfe8ef82a8
2 changed files with 14 additions and 6 deletions

View File

@@ -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>:

View File

@@ -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;
@@ -392,6 +394,7 @@ rewrite_resolv_conf (NMNamedManager *mgr, NMIP4Config *config, GError **error)
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;
} }