return false;
}
+ if (!_set_latest_settime(_time))
+ LOGE("DB is failed.");
+
if (using_rtc) {
char buf[1024];
char log_tag[ALARMMGR_LOG_TAG_SIZE] = {0,};
LOGD("ALARM_SET_RTC ioctl is succeed. [%d]", (int)_time);
strncpy(log_tag, "SET RTC START", sizeof(log_tag) - 1);
_save_module_log(log_tag, log_message);
-
- if (!_set_latest_settime(_time))
- LOGE("DB is failed.");
return true;
}
} else {
continue;
}
+ if (entry->due_time + diff_time < diff_time) {
+ LOGE("time_t OVERFLOW!! %ld %f id %d",
+ entry->due_time, diff_time, entry->alarm_id);
+ continue;
+ }
entry->due_time += diff_time;
entry->base_info.reserved_info = new_time;
} else {
- entry->due_time += diff_time;
if (is_rtc_reset) {
+ if (entry->due_time > new_time)
+ continue;
+
entry->due_time = new_time +
- ((entry->due_time - new_time) % base_info->mode.u_interval.interval);
+ (new_time % base_info->mode.u_interval.interval);
LOGE("[ RTC reset]: new time %s %ld, diff %f, id %d duetime %s %ld %ld",
ctime(&new_time), new_time, diff_time, entry->alarm_id,
ctime(&entry->due_time), entry->due_time,
base_info->mode.u_interval.interval);
+ } else {
+ if (entry->due_time + diff_time < diff_time) {
+ LOGE("time_t OVERFLOW!! %ld %f id %d",
+ entry->due_time, diff_time, entry->alarm_id);
+ continue;
+ }
+ entry->due_time += diff_time;
}
}
LOGE("power saving mode init failed");
exit(1);
}
+ }
- if (_get_latest_settime(&latest_settime)) {
- time_t current_time;
- time(¤t_time);
- if (current_time < latest_settime) {
- LOGE("[RTC_RESET] RTC goes back into the past.");
- _save_module_log("FAIL: RTC_RESET", "RTC goes back into the past.");
- is_rtc_reset = true;
- }
+ if (_get_latest_settime(&latest_settime)) {
+ time_t current_time;
+ time(¤t_time);
+ if (current_time < latest_settime) {
+ LOGE("[RTC_RESET] RTC goes back into the past.");
+ _save_module_log("FAIL: RTC_RESET", "RTC goes back into the past.");
+ is_rtc_reset = true;
}
}