From: Samuel Ortiz Date: Thu, 25 Aug 2011 15:34:06 +0000 (+0200) Subject: device: Remove power pending timeout iff there is a pending request X-Git-Tag: 0.78~294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7ae93c1cb3e153626e769c73d1eb53ebaf92012;p=platform%2Fupstream%2Fconnman.git device: Remove power pending timeout iff there is a pending request In the ethernet case, there won't be any. --- diff --git a/src/device.c b/src/device.c index cdd9118..a5b815f 100644 --- a/src/device.c +++ b/src/device.c @@ -663,9 +663,12 @@ int connman_device_set_powered(struct connman_device *device, if (device->powered == powered) return -EALREADY; - /* Reset pending request */ - g_source_remove(device->pending_timeout); - device->pending_timeout = 0; + if (device->pending_timeout) { + /* Reset pending request */ + g_source_remove(device->pending_timeout); + device->pending_timeout = 0; + } + device->powered_pending = PENDING_NONE; device->powered = powered;