If device is powered, set powered_pending from device_set_powered
authorYingan Deng <ying.an.deng@intel.com>
Thu, 5 Aug 2010 14:32:01 +0000 (16:32 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 6 Aug 2010 13:14:38 +0000 (15:14 +0200)
If connman_device_set_powered() is called when the device is already
powered, powered_pending should be set to the same value.

src/device.c

index 87e3533..c1d74b6 100644 (file)
@@ -989,8 +989,10 @@ int connman_device_set_powered(struct connman_device *device,
                device->pending = NULL;
        }
 
-       if (device->powered == powered)
+       if (device->powered == powered) {
+               device->powered_pending = powered;
                return -EALREADY;
+       }
 
        if (powered == TRUE)
                __connman_device_enable(device);