Set powered variable from the global function
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 12 Jul 2009 08:04:43 +0000 (01:04 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 12 Jul 2009 08:04:43 +0000 (01:04 -0700)
src/device.c

index 1772e19..31074fa 100644 (file)
@@ -227,6 +227,9 @@ static int set_powered(struct connman_device *device, connman_bool_t powered)
                        err = -EINVAL;
        }
 
+       if (err == 0)
+               device->powered = powered;
+
        return err;
 }
 
@@ -404,8 +407,6 @@ static DBusMessage *set_property(DBusConnection *conn,
 
                        return NULL;
                }
-
-               device->powered = powered;
        } else if (g_str_equal(name, "ScanInterval") == TRUE) {
                connman_uint16_t interval;