#include <time.h>
-#define EPOCH_TIME_REF 1526515200000000 /* 2018-05-17 GMT */
+#define EPOCH_TIME_REF 1526515200 /* 2018-05-17 GMT */
long long common_get_monotonic_time(void);
long long common_get_monotonic_coarse_time(void);
#define __TT_DAEMON_CONFIG_H__
#include <stdbool.h>
-#include "ttd-cmd.h"
#define CONFIG_PATH_MAX 1024
int ttd_config_write_boolean(const char *group, const char *key, bool value);
int ttd_config_write_string(const char *group, const char *key, const char *value);
int ttd_config_remove_group(const char *group);
-int tt_config_remove_key(const char *group, const char *key);
+int ttd_config_remove_key(const char *group, const char *key);
#endif /* __TT_DAEMON_CONFIG_H__ */
current_time = common_get_epoch_time();
- if ((current_time * 1000000) > EPOCH_TIME_REF && !d_data->is_time_set) {
+ if (current_time > EPOCH_TIME_REF && !d_data->is_time_set) {
/* Do something need correct time after here */
- _D("We assume that system time is correct, because current[%lld] is bigger than 2018-05-17", current_time * 1000000);
+ _D("We assume that system time is correct, because current[%lld] is bigger than 2018-05-17", current_time);
d_data->is_time_set = true;
g_idle_add(__do_device_register, d_data);
}
g_unix_signal_add(SIGINT, _handle_sigint, d_data);
g_unix_signal_add(SIGTERM, _handle_sigterm, d_data);
- if (vconf_notify_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED, __time_changed, d_data) < 0) {
- _E("Failed to set vconf key changed");
- }
+ vconf_notify_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED, __time_changed, d_data);
ttd_queue_init();
ttd_conn_mgr_init();
ttd_http_init();
ttd_cloud_conn_state_set(TTD_CLOUD_CONN_STATE_DISCONNECTED);
-
- if (ttd_worker_interface_init(&(d_data->worker_itf_h)) < 0)
- _E("Failed to initialize worker interface");
+ ttd_worker_interface_init(&(d_data->worker_itf_h));
d_data->thread_pool =
g_thread_pool_new(__main_thread_pool_func, d_data, -1, FALSE, NULL);
}
ret = g_key_file_get_integer(gkf, group, key, &error);
- if (!error) {
+ if (error) {
_E("Failed to get integer[%s]", error->message);
g_error_free(error);
return -1;
}
ret = g_key_file_get_boolean(gkf, group, key, &error);
- if (!ret) {
+ if (error) {
_E("Failed to get boolean[%s]", error->message);
g_error_free(error);
return -1;
}
ret = g_key_file_get_string(gkf, group, key, &error);
- if (!ret) {
+ if (error) {
_E("Failed to get string[%s]", error->message);
g_error_free(error);
return -1;
return 0;
}
-int ttd_config_write_bool(const char *group, const char *key, bool value)
+int ttd_config_write_boolean(const char *group, const char *key, bool value)
{
retv_if(!group, -1);
retv_if(!key, -1);