static int timeout_running = 0;
static SCH_TimeoutID timeout_id;
+static int skip_interrupts;
+
/* ================================================== */
/* Maximum number of samples held */
LOG(LOGS_ERR, LOGF_RtcLinux, "Could not start measurement : %s", strerror(errno));
return;
}
+ skip_interrupts = 1;
} else {
status = ioctl(fd, RTC_UIE_OFF, 0);
if (status < 0) {
int error = 0;
status = read(fd, &data, sizeof(data));
- if (operating_mode == OM_NORMAL)
- status = read(fd, &data, sizeof(data));
+
if (status < 0) {
/* This looks like a bad error : the file descriptor was indicating it was
* ready to read but we couldn't read anything. Give up. */
return;
}
+ if (skip_interrupts > 0) {
+ /* Wait for the next interrupt, this one may be bogus */
+ skip_interrupts--;
+ return;
+ }
+
if ((data & RTC_UIE) == RTC_UIE) {
/* Update interrupt detected */