*
* Connection Manager
*
- * Copyright (C) 2007-2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
enum timezone_updates timezone_value;
keyfile = __connman_storage_load_global();
- if (keyfile == NULL)
+ if (!keyfile)
return;
str = g_key_file_get_string(keyfile, "global", "TimeUpdates", NULL);
const char *str;
keyfile = __connman_storage_load_global();
- if (keyfile == NULL)
+ if (!keyfile)
keyfile = g_key_file_new();
str = time_updates2string(time_updates_config);
- if (str != NULL)
+ if (str)
g_key_file_set_string(keyfile, "global", "TimeUpdates", str);
else
g_key_file_remove_key(keyfile, "global", "TimeUpdates", NULL);
str = timezone_updates2string(timezone_updates_config);
- if (str != NULL)
+ if (str)
g_key_file_set_string(keyfile, "global", "TimezoneUpdates",
str);
else
int i;
char **timeservers = __connman_timeserver_system_get();
- if (timeservers == NULL)
+ if (!timeservers)
return;
- for (i = 0; timeservers[i] != NULL; i++) {
+ for (i = 0; timeservers[i]; i++) {
dbus_message_iter_append_basic(iter,
DBUS_TYPE_STRING, ×ervers[i]);
}
DBG("conn %p", conn);
reply = dbus_message_new_method_return(msg);
- if (reply == NULL)
+ if (!reply)
return NULL;
dbus_message_iter_init_append(reply, &array);
}
str = time_updates2string(time_updates_config);
- if (str != NULL)
+ if (str)
connman_dbus_dict_append_basic(&dict, "TimeUpdates",
DBUS_TYPE_STRING, &str);
- if (timezone_config != NULL)
+ if (timezone_config)
connman_dbus_dict_append_basic(&dict, "Timezone",
DBUS_TYPE_STRING, &timezone_config);
str = timezone_updates2string(timezone_updates_config);
- if (str != NULL)
+ if (str)
connman_dbus_dict_append_basic(&dict, "TimezoneUpdates",
DBUS_TYPE_STRING, &str);
DBG("conn %p", conn);
- if (dbus_message_iter_init(msg, &iter) == FALSE)
+ if (!dbus_message_iter_init(msg, &iter))
return __connman_error_invalid_arguments(msg);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
type = dbus_message_iter_get_arg_type(&value);
- if (g_str_equal(name, "Time") == TRUE) {
+ if (g_str_equal(name, "Time")) {
struct timeval tv;
dbus_uint64_t newval;
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
CONNMAN_CLOCK_INTERFACE, "Time",
DBUS_TYPE_UINT64, &newval);
- } else if (g_str_equal(name, "TimeUpdates") == TRUE) {
+ } else if (g_str_equal(name, "TimeUpdates")) {
const char *strval;
enum time_updates newval;
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
CONNMAN_CLOCK_INTERFACE, "TimeUpdates",
DBUS_TYPE_STRING, &strval);
- } else if (g_str_equal(name, "Timezone") == TRUE) {
+ } else if (g_str_equal(name, "Timezone")) {
const char *strval;
if (type != DBUS_TYPE_STRING)
dbus_message_iter_get_basic(&value, &strval);
if (__connman_timezone_change(strval) < 0)
- return __connman_error_invalid_arguments(msg);
- } else if (g_str_equal(name, "TimezoneUpdates") == TRUE) {
+ return __connman_error_invalid_arguments(msg);
+ } else if (g_str_equal(name, "TimezoneUpdates")) {
const char *strval;
enum timezone_updates newval;
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
CONNMAN_CLOCK_INTERFACE, "TimezoneUpdates",
DBUS_TYPE_STRING, &strval);
- } else if (g_str_equal(name, "Timeservers") == TRUE) {
+ } else if (g_str_equal(name, "Timeservers")) {
DBusMessageIter entry;
char **str = NULL;
GSList *list = NULL;
dbus_message_iter_next(&entry);
}
- if (list != NULL) {
+ if (list) {
str = g_new0(char *, count+1);
- while (list != NULL) {
+ while (list) {
count--;
str[count] = list->data;
list = g_slist_delete_link(list, list);
__connman_timeserver_system_set(str);
- if (str != NULL)
+ if (str)
g_strfreev(str);
connman_dbus_property_changed_array(CONNMAN_MANAGER_PATH,
g_free(timezone_config);
timezone_config = __connman_timezone_lookup();
- if (timezone_config == NULL)
+ if (!timezone_config)
return;
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
DBG("");
connection = connman_dbus_get_connection();
- if (connection == NULL)
+ if (!connection)
return -1;
__connman_timezone_init();
{
DBG("");
- if (connection == NULL)
+ if (!connection)
return;
g_dbus_unregister_interface(connection, CONNMAN_MANAGER_PATH,