RTC_Initialise(void)
{
char *file_name;
- int ok;
+
+ driver_initialised = 0;
/* This is how we tell whether the user wants to load the RTC
driver, if he is on a machine where it is an option. */
if (driver.init) {
if ((driver.init)()) {
- ok = 1;
- } else {
- ok = 0;
+ driver_initialised = 1;
}
} else {
- ok = 0;
- }
-
- if (ok) {
- driver_initialised = 1;
- } else {
- driver_initialised = 0;
- LOG(LOGS_ERR, LOGF_Rtc, "Real time clock not supported on this operating system");
+ LOG(LOGS_ERR, LOGF_Rtc, "RTC not supported on this operating system");
}
-
- } else {
- driver_initialised = 0;
}
}
if (driver_initialised) {
(driver.time_init)(after_hook, anything);
} else {
- LOG(LOGS_ERR, LOGF_Rtc, "Can't initialise from real time clock, driver not loaded");
(after_hook)(anything);
}
}
coefs_file_name);
}
fclose(in);
- } else {
- LOG(LOGS_WARN, LOGF_RtcLinux, "Could not open RTC file %s for reading",
- coefs_file_name);
}
}
}
fd = open (CNF_GetRtcDevice(), O_RDWR);
if (fd < 0) {
- LOG(LOGS_ERR, LOGF_RtcLinux, "Could not open %s, %s", CNF_GetRtcDevice(), strerror(errno));
+ LOG(LOGS_ERR, LOGF_RtcLinux, "Could not open RTC device %s : %s",
+ CNF_GetRtcDevice(), strerror(errno));
return 0;
}