diff options
author | Jiwoong Im <jiwoong.im@samsung.com> | 2016-05-27 13:54:14 +0900 |
---|---|---|
committer | Jiwoong Im <jiwoong.im@samsung.com> | 2016-05-27 15:11:55 +0900 |
commit | e1db7d47f8edce01417d81f9f93f753329e94a8c (patch) | |
tree | 1ec240d9e04ca1ebdc65d713f95c016776ce6fe1 | |
parent | ff59afb861d37495dc8e0b3f6b64ceeafe320048 (diff) | |
download | alarm-manager-e1db7d47f8edce01417d81f9f93f753329e94a8c.tar.gz alarm-manager-e1db7d47f8edce01417d81f9f93f753329e94a8c.tar.bz2 alarm-manager-e1db7d47f8edce01417d81f9f93f753329e94a8c.zip |
Fix rtc_time_set to set utc timesubmit/tizen/20160531.024853accepted/tizen/wearable/20160602.022757accepted/tizen/tv/20160602.022622accepted/tizen/mobile/20160602.023042accepted/tizen/ivi/20160602.022910accepted/tizen/common/20160602.140103
Change-Id: I1c8dbb111d896341416870d8ec029a35858ce943
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
-rw-r--r-- | alarm-manager.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/alarm-manager.c b/alarm-manager.c index 7370a57..e36ad32 100644 --- a/alarm-manager.c +++ b/alarm-manager.c @@ -271,7 +271,7 @@ int __set_time(time_t _time) const char *rtc0 = default_rtc; struct rtc_time _rtc_time; struct timeval tv; - struct tm tm, *localtime_res; + struct tm tm, *gmtime_res; #ifdef _APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG char log_tag[ALARMMGR_LOG_TAG_SIZE] = {0,}; char log_message[ALARMMGR_LOG_MESSAGE_SIZE] = {0,}; @@ -290,9 +290,9 @@ int __set_time(time_t _time) tv.tv_sec = _time; tv.tv_usec = 0; - localtime_res = localtime_r(&(tv.tv_sec), &tm); - if (!localtime_res) - ALARM_MGR_EXCEPTION_PRINT("localtime_r is failed. [%d]", errno); + gmtime_res = gmtime_r(&(tv.tv_sec), &tm); + if (!gmtime_res) + ALARM_MGR_EXCEPTION_PRINT("gmtime_r is failed. [%d]", errno); memset(&_rtc_time, 0, sizeof(_rtc_time)); _rtc_time.tm_sec = tm.tm_sec; @@ -1981,7 +1981,7 @@ gboolean alarm_manager_alarm_set_rtc_time(AlarmManager *pObj, GDBusMethodInvocat char buf[1024]; current_time = time(NULL); - alarm_tm = localtime_r(¤t_time, &tm); + alarm_tm = gmtime_r(¤t_time, &tm); if (alarm_tm == NULL) { ALARM_MGR_EXCEPTION_PRINT("alarm_tm is NULL"); return true; |