ifupdown: return NULL hostname, not a zero-length string

This commit is contained in:
Dan Williams 2010-09-24 18:54:37 -05:00
parent 9e2ec0b7a1
commit 6f2aa8a817

View file

@ -565,6 +565,12 @@ update_system_hostname(NMInotifyHelper *inotify_helper,
priv->hostname = g_strstrip(hostname_file);
/* We shouldn't return a zero-length hostname, but NULL */
if (priv->hostname && !strlen (priv->hostname)) {
g_free (priv->hostname);
priv->hostname = NULL;
}
g_object_notify (G_OBJECT (config), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME);
}