mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-07 02:50:38 +01:00
device: refactor using nm_clear_g_source() for priv->carrier_wait_id
(cherry picked from commit c89fd1ea76)
This commit is contained in:
parent
31b594561c
commit
971a7611bd
1 changed files with 3 additions and 10 deletions
|
|
@ -1325,9 +1325,7 @@ nm_device_set_carrier (NMDevice *self, gboolean carrier)
|
|||
link_disconnect_action_cancel (self);
|
||||
klass->carrier_changed (self, TRUE);
|
||||
|
||||
if (priv->carrier_wait_id) {
|
||||
g_source_remove (priv->carrier_wait_id);
|
||||
priv->carrier_wait_id = 0;
|
||||
if (nm_clear_g_source (&priv->carrier_wait_id)) {
|
||||
nm_device_remove_pending_action (self, "carrier wait", TRUE);
|
||||
_carrier_wait_check_queued_act_request (self);
|
||||
}
|
||||
|
|
@ -7106,9 +7104,7 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware)
|
|||
* a timeout is reached.
|
||||
*/
|
||||
if (nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) {
|
||||
if (priv->carrier_wait_id)
|
||||
g_source_remove (priv->carrier_wait_id);
|
||||
else
|
||||
if (!nm_clear_g_source (&priv->carrier_wait_id))
|
||||
nm_device_add_pending_action (self, "carrier wait", TRUE);
|
||||
priv->carrier_wait_id = g_timeout_add_seconds (5, carrier_wait_timeout, self);
|
||||
}
|
||||
|
|
@ -9238,10 +9234,7 @@ dispose (GObject *object)
|
|||
|
||||
g_hash_table_remove_all (priv->available_connections);
|
||||
|
||||
if (priv->carrier_wait_id) {
|
||||
g_source_remove (priv->carrier_wait_id);
|
||||
priv->carrier_wait_id = 0;
|
||||
}
|
||||
nm_clear_g_source (&priv->carrier_wait_id);
|
||||
|
||||
_clear_queued_act_request (priv);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue