Fix rtc_time_set to set utc time 65/71765/2 accepted/tizen/common/20160602.140103 accepted/tizen/ivi/20160602.022910 accepted/tizen/mobile/20160602.023042 accepted/tizen/tv/20160602.022622 accepted/tizen/wearable/20160602.022757 submit/tizen/20160531.024853
authorJiwoong Im <jiwoong.im@samsung.com>
Fri, 27 May 2016 04:54:14 +0000 (13:54 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Fri, 27 May 2016 06:11:55 +0000 (15:11 +0900)
Change-Id: I1c8dbb111d896341416870d8ec029a35858ce943
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
alarm-manager.c

index 7370a57..e36ad32 100644 (file)
@@ -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(&current_time, &tm);
+       alarm_tm = gmtime_r(&current_time, &tm);
        if (alarm_tm == NULL) {
                ALARM_MGR_EXCEPTION_PRINT("alarm_tm is NULL");
                return true;