2007-09-20 Dan Williams <dcbw@redhat.com>
* src/nm-device.c - (nm_device_is_activating): work around a race between auto-activation and the user activating the same device that is being auto-activated git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2842 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2007-09-20 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-device.c
|
||||
- (nm_device_is_activating): work around a race between auto-activation
|
||||
and the user activating the same device that is being auto-activated
|
||||
|
||||
2007-09-20 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-device-interface.c
|
||||
|
@@ -1278,6 +1278,8 @@ nm_device_activate (NMDeviceInterface *device,
|
||||
gboolean
|
||||
nm_device_is_activating (NMDevice *device)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
|
||||
|
||||
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
|
||||
|
||||
switch (nm_device_get_state (device)) {
|
||||
@@ -1291,6 +1293,14 @@ nm_device_is_activating (NMDevice *device)
|
||||
break;
|
||||
}
|
||||
|
||||
/* There's a small race between the time when stage 1 is scheduled
|
||||
* and when the device actually sets STATE_PREPARE when the activation
|
||||
* handler is actually run. If there's an activation handler scheduled
|
||||
* we're activating anyway.
|
||||
*/
|
||||
if (priv->act_source_id)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user