mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 19:20:35 +01:00
ifcfg-rh: fix crash on ignored file change
Don't crash when a file we don't care about changes.
This commit is contained in:
parent
bb35e0a9e2
commit
3e8547ff1b
1 changed files with 17 additions and 17 deletions
|
|
@ -343,24 +343,24 @@ dir_changed (GFileMonitor *monitor,
|
|||
/* Given any ifcfg, keys, or routes file, get the ifcfg file path */
|
||||
name = utils_get_ifcfg_path (path);
|
||||
g_free (path);
|
||||
|
||||
connection = g_hash_table_lookup (priv->connections, name);
|
||||
switch (event_type) {
|
||||
case G_FILE_MONITOR_EVENT_DELETED:
|
||||
PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name);
|
||||
if (connection)
|
||||
remove_connection (plugin, connection);
|
||||
break;
|
||||
case G_FILE_MONITOR_EVENT_CREATED:
|
||||
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
|
||||
/* Update or new */
|
||||
connection_new_or_changed (plugin, name, connection);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if (name) {
|
||||
connection = g_hash_table_lookup (priv->connections, name);
|
||||
switch (event_type) {
|
||||
case G_FILE_MONITOR_EVENT_DELETED:
|
||||
PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name);
|
||||
if (connection)
|
||||
remove_connection (plugin, connection);
|
||||
break;
|
||||
case G_FILE_MONITOR_EVENT_CREATED:
|
||||
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
|
||||
/* Update or new */
|
||||
connection_new_or_changed (plugin, name, connection);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue