Bug 8123
Summary: | clock/hwclock utilities die since 0101-2000 | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | typo |
Component: | clock | Assignee: | Cristian Gafton <gafton> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | 5.0 | CC: | gedetil |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2000-02-05 18:40:02 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
typo
2000-01-03 03:07:32 UTC
*** Bug 8134 has been marked as a duplicate of this bug. *** *** Bug 8108 has been marked as a duplicate of this bug. *** I'm seeing the same problem with util-linux-2.8-11, under Red Hat 5.2. With that version, at least, the error message only shows up when /dev/rtc is not available (e.g. if it's busy due to some other software like VMware), in which case hwclock is going directly to the hardware clock. The following patch seems to have fixed the problem for me. --- util-linux-2.8/sys-utils.orig/hwclock.c Thu Jun 11 17:30:55 1998 +++ util-linux-2.8/sys-utils/hwclock.c Fri Jan 7 15:07:01 2000 @@ -845,6 +845,9 @@ */ if (hclock_read_bcd(9) >= 70) tm->tm_year = hclock_read_bcd(9); else tm->tm_year = hclock_read_bcd(9) + 100; + if (debug) + printf ("Year read from old Hardware Clock: c=%02d, y=%02d, tm_year=%02d\n", + hclock_read_bcd(50), hclock_read_bcd(9), tm->tm_year); } else { tm->tm_year = hclock_read_bcd(50) * 100 + hclock_read_bcd(9) - 1900; /* Note: Byte 50 contains centuries since A.D. Byte 9 contains @@ -854,6 +857,10 @@ conceivably be years since the beginning of the current century. If so, this code won't work after 1999. */ + if (tm->tm_year < 70) tm->tm_year += 100; /* Y2K bug */ + if (debug) + printf ("Year read from new Hardware Clock: c=%02d, y=%02d, tm_year=%02d\n", + hclock_read_bcd(50), hclock_read_bcd(9), tm->tm_year); } /* Unless the clock changed while we were reading, consider this a good clock read . This fix is essentially just the one line. The debug printf code is not necessary, of course, but it helped me to find out what was going on. After running the patched hwclock program, with the -w option, the century byte was correctly updated, and now shows up as 20, as it should. (I imagine that rebooting the system would have allowed the BIOS to update the century byte on its own, which would have eliminated the need for this patch, but it wasn't convenient for me to reboot the system in question.) This is fixed in the current util-linux. |