summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-02-14 11:53:05 +0100
committerThomas Haller <thaller@redhat.com>2020-02-14 11:56:44 +0100
commitd50856b5c66e6d7a8ab1af7826297787e72e06e7 (patch)
tree55c92c8f3427abf8237800f8f0a3065832a5ea1c /src
parentde62da297e506b1c5ad9b7dcc9132c681d089efe (diff)
downloadNetworkManager-d50856b5c66e6d7a8ab1af7826297787e72e06e7.tar.gz
manager: drop devices_inited field in NManagerPrivate for devices_inited_id
It is redundant. Drop it. Also, we don't need to cancel and reschedule the idle source in nm_manager_start(). First of all, it really shouldn't be pending. Second, contrary to a timer, when an idle source is already pending, then the pending one will run at the right time.
Diffstat (limited to 'src')
-rw-r--r--src/nm-manager.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index c610a67638..f28c3d05cf 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -195,7 +195,6 @@ typedef struct {
NMConnectivityState connectivity_state;
bool startup:1;
- bool devices_inited:1;
bool sleeping:1;
bool net_enabled:1;
@@ -1541,7 +1540,7 @@ check_if_startup_complete (NMManager *self)
if (!priv->startup)
return;
- if (!priv->devices_inited)
+ if (priv->devices_inited_id)
return;
reason = nm_settings_get_startup_complete_blocked_reason (priv->settings);
@@ -6620,7 +6619,6 @@ devices_inited_cb (gpointer user_data)
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
priv->devices_inited_id = 0;
- priv->devices_inited = TRUE;
check_if_startup_complete (self);
return G_SOURCE_REMOVE;
}
@@ -6690,8 +6688,8 @@ nm_manager_start (NMManager *self, GError **error)
for (i = 0; connections[i]; i++)
connection_changed (self, connections[i]);
- nm_clear_g_source (&priv->devices_inited_id);
- priv->devices_inited_id = g_idle_add_full (G_PRIORITY_LOW + 10, devices_inited_cb, self, NULL);
+ if (!priv->devices_inited_id)
+ priv->devices_inited_id = g_idle_add_full (G_PRIORITY_LOW + 10, devices_inited_cb, self, NULL);
return TRUE;
}