From: Matt Francomb Date: Tue, 26 Oct 2010 19:08:35 +0000 (+0200) Subject: device: Save zero scan_interval values X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~2266 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b3daa981d62a6a6831b5191ec8507c8749728ac;p=profile%2Fivi%2Fconnman.git device: Save zero scan_interval values 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. --- diff --git a/src/device.c b/src/device.c index 1b721ee..f79e991 100644 --- a/src/device.c +++ b/src/device.c @@ -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; }