due_time = mktime(&duetime_tm);
}
- while (__alarm_info->start > due_time || current_time > due_time || ((!is_time_changed) && (current_time == due_time)))
+ while (__alarm_info->start > due_time || current_time > due_time || ((!is_time_changed) && (current_time == due_time))) {
+ if (due_time + alarm_info->mode.u_interval.interval < due_time) {
+ ALARM_MGR_LOG_PRINT("time_t OVERFLOW!! duetime = %d", due_time);
+ due_time = -1;
+ break;
+ }
+
due_time += alarm_info->mode.u_interval.interval;
+ }
localtime_r(&due_time, &duetime_tm);
start->sec = duetime_tm.tm_sec;
return due_time;
-
}
static time_t __alarm_next_duetime_annually(__alarm_info_t *__alarm_info)
while (__alarm_info->start > due_time || current_time > due_time || ((!is_time_changed) && (current_time == due_time))) {
duetime_tm.tm_year += 1;
due_time = mktime(&duetime_tm);
+ if (due_time < 0) {
+ ALARM_MGR_LOG_PRINT("time_t OVERFLOW!! duetime = %d", due_time);
+ break;
+ }
}
return due_time;
duetime_tm.tm_year += 1;
}
due_time = mktime(&duetime_tm);
+ if (due_time < 0) {
+ ALARM_MGR_LOG_PRINT("time_t OVERFLOW!! duetime = %d", due_time);
+ break;
+ }
}
return due_time;