summaryrefslogtreecommitdiffstats
path: root/hwclock/hwclock.c
diff options
context:
space:
mode:
authorKarel Zak2008-08-09 01:22:08 +0200
committerKarel Zak2008-08-13 11:40:23 +0200
commit3b96a7acbc8e3805c6af6c3e185f007b1d68118d (patch)
treefeca7833dc2e4d6dd270f39fcfae908b94af0e0d /hwclock/hwclock.c
parentmount: add docs about utf8=0 for vfat (diff)
downloadkernel-qcow2-util-linux-3b96a7acbc8e3805c6af6c3e185f007b1d68118d.tar.gz
kernel-qcow2-util-linux-3b96a7acbc8e3805c6af6c3e185f007b1d68118d.tar.xz
kernel-qcow2-util-linux-3b96a7acbc8e3805c6af6c3e185f007b1d68118d.zip
hwclock: use carefully synchronize_to_clock_tick() return codes
* It seems that rtc-isl1208 0-006f: chip found, driver version 0.3 rtc-isl1208 0-006f: rtc core: registered rtc-isl1208 as rtc0 rtc-isl1208 0-006f: rtc power failure detected, please set clock. causes that hardware clock returns persistent time and synchronization is impossible. The hwclock(8) has to ignore this problem and allows to set clock anyway. * synchronize_to_clock_tick() shouldn't to print the "...got clock tick" debug message in case of failure. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'hwclock/hwclock.c')
-rw-r--r--hwclock/hwclock.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hwclock/hwclock.c b/hwclock/hwclock.c
index 12e7676bb..82da273df 100644
--- a/hwclock/hwclock.c
+++ b/hwclock/hwclock.c
@@ -352,7 +352,12 @@ synchronize_to_clock_tick(void) {
rc = ur->synchronize_to_clock_tick();
- if (debug) printf(_("...got clock tick\n"));
+ if (debug) {
+ if (rc)
+ printf(_("...synchronization failed\n"));
+ else
+ printf(_("...got clock tick\n"));
+ }
return rc;
}
@@ -1093,8 +1098,8 @@ manipulate_clock(const bool show, const bool adjust, const bool noadjfile,
if (show || adjust || hctosys || !noadjfile) {
/* data from HW-clock are required */
rc = synchronize_to_clock_tick();
- if (rc)
- return EX_IOERR;
+ if (rc && rc != 2) /* 2= synchronization timeout */
+ return EX_IOERR;
gettimeofday(&read_time, NULL);
rc = read_hardware_clock(universal, &hclock_valid, &hclocktime);
if (rc)