summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-07-16 15:18:59 +0200
committerThomas Haller <thaller@redhat.com>2015-07-16 15:18:59 +0200
commitac348d5c9b6ea44cf9ced07eaa33200915897d21 (patch)
tree540df720d464e7367a12ebf63bc8efe84101511d
parent5019d46066785bd53d2bdaea5a97e9b98d7ec6fb (diff)
downloadNetworkManager-jk/ifcfg-rh-udev-DEVTIMEOUT-rh1192633.tar.gz
ifcfg-rh: reorder checks in nm_ifcfg_connection_check_devtimeout()jk/ifcfg-rh-udev-DEVTIMEOUT-rh1192633
Move the check for a platform link before devtimeout_from_file(). The check in the platform cache should be more performant and yield success in most cases. This can save reading and parsing the ifcfg-rh file.
-rw-r--r--src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
index 840f5df511..a5574a80ba 100644
--- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
+++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
@@ -161,14 +161,15 @@ nm_ifcfg_connection_check_devtimeout (NMIfcfgConnection *self)
filename = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (self));
if (!filename)
return;
- devtimeout = devtimeout_from_file (filename);
- if (!devtimeout)
- return;
pllink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, ifname);
if (pllink && pllink->initialized)
return;
+ devtimeout = devtimeout_from_file (filename);
+ if (!devtimeout)
+ return;
+
/* ONBOOT=yes, DEVICE and DEVTIMEOUT are set, but device is not present */
nm_settings_connection_set_ready (NM_SETTINGS_CONNECTION (self), FALSE);