mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 10:15:07 -05:00
RTC usage bails out cleanly if accessing it goes wrong (e.g. HPET without generic RTC emulation)
This commit is contained in:
committed by
Richard P. Curnow
parent
13ace061fa
commit
77da5b6144
12
rtc_linux.c
12
rtc_linux.c
@@ -867,9 +867,19 @@ read_from_device(void *any)
|
||||
|
||||
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. */
|
||||
LOG(LOGS_ERR, LOGF_RtcLinux, "Could not read flags %s : %s", CNF_GetRtcDevice(), strerror(errno));
|
||||
error = 1;
|
||||
goto turn_off_interrupt;
|
||||
SCH_RemoveInputFileHandler(fd);
|
||||
switch_interrupts(0); /* Likely to raise error too, but just to be sure... */
|
||||
close(fd);
|
||||
fd = -1;
|
||||
if (logfile) {
|
||||
fclose(logfile);
|
||||
logfile = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ((data & RTC_UIE) == RTC_UIE) {
|
||||
|
||||
Reference in New Issue
Block a user