int ret = 0;
struct timeval tv;
struct tm tm, *gmtime_res;
+
+ tv.tv_sec = _time;
+ tv.tv_usec = 0;
+
+ gmtime_res = gmtime_r(&(tv.tv_sec), &tm);
+ if (!gmtime_res)
+ ALARM_MGR_EXCEPTION_PRINT("gmtime_r is failed. [%d]", errno);
+
+ ret = settimeofday(&tv, NULL);
+ if (ret < 0)
+ ALARM_MGR_EXCEPTION_PRINT("settimeofday is failed.[%d]", errno);
+
#ifdef _APPFW_FEATURE_WAKEUP_USING_RTC
/* Using /dev/alarm, this function changes both OS time and RTC. */
const char *rtc0 = default_rtc;
#else
ALARM_MGR_LOG_PRINT("[alarm-server] RTC does not work.");
#endif /* _APPFW_FEATURE_WAKEUP_USING_RTC */
- tv.tv_sec = _time;
- tv.tv_usec = 0;
-
- gmtime_res = gmtime_r(&(tv.tv_sec), &tm);
- if (!gmtime_res)
- ALARM_MGR_EXCEPTION_PRINT("gmtime_r is failed. [%d]", errno);
-
- ret = settimeofday(&tv, NULL);
- if (ret < 0)
- ALARM_MGR_EXCEPTION_PRINT("settimeofday is failed.[%d]", errno);
return 1;
}