device: Save zero scan_interval values
authorMatt Francomb <mfrancomb@aminocom.com>
Tue, 26 Oct 2010 19:08:35 +0000 (21:08 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 26 Oct 2010 19:11:37 +0000 (21:11 +0200)
For some devices it makes sense to not run periodic wifi scans at all.
Although the default value is kept at 300 seconds for wifi, one should be
able to set that value to 0, and fetch it back after rebooting.

src/device.c

index 1b721ee..f79e991 100644 (file)
@@ -1656,7 +1656,7 @@ static int device_load(struct connman_device *device)
        case CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE:
                val = g_key_file_get_integer(keyfile, identifier,
                                                "ScanInterval", &error);
-               if (error == NULL && val > 0)
+               if (error == NULL)
                        device->scan_interval = val;
                g_clear_error(&error);
                break;
@@ -1694,8 +1694,7 @@ static int device_save(struct connman_device *device)
                break;
        case CONNMAN_DEVICE_MODE_NETWORK_SINGLE:
        case CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE:
-               if (device->scan_interval > 0)
-                       g_key_file_set_integer(keyfile, identifier,
+               g_key_file_set_integer(keyfile, identifier,
                                        "ScanInterval", device->scan_interval);
                break;
        }