summaryrefslogtreecommitdiffstats
path: root/hwclock/rtc.c
Commit message (Collapse)AuthorAgeFilesLines
* hwclock: don't open /dev/rtc repeatedlyKarel Zak2008-08-181-22/+30
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: read_hardware_clock_rtc() need to return error codesKarel Zak2008-08-131-3/+3
| | | | | | We shouldn't ignore RTC_RD_TIME/RTCGET error codes. Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: use time limit for synchronization busy waitKarel Zak2008-08-131-11/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: remove x86_64-specific bogonDavid Brownell2008-08-121-1/+1
| | | | | | | | | | I was puzzled why "hwclock" wrongly reported my x86_64 sytem didn't support RTC update interrupts. Bogus #ifdef, that's why ... added by the 2.11y patch (from 2.11t). Probably this whole #ifdef should just vanish ... if the kernel rejects UIE_ON, the program ought to just cope with it. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* hwclock: always reads hardware clockKarel Zak2008-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a pity that hwclock first tries to read the clock when running hwclock --systohc --noadjfile --utc and exits as this fails. I cannot see a reason to read first in that case. Old version: # hwclock --systohc --noadjfile --utc --debug hwclock from util-linux-ng 2.14 Using /dev interface to clock. Assuming hardware clock is kept in UTC time. Waiting for clock tick... /dev/rtc does not have interrupt functions. Waiting in loop for time from /dev/rtc to change ...got clock tick Time read from Hardware Clock: 2008/06/17 11:18:24 Hw clock time : 2008/06/17 11:18:24 = 1213701504 seconds since 1969 Time elapsed since reference time has been 0.904855 seconds. Delaying further to reach the next full second. Setting Hardware Clock to 11:18:24 = 1213701504 seconds since 1969 ioctl(RTC_SET_TIME) was successful. New version: # hwclock --systohc --noadjfile --utc --debug hwclock from util-linux-ng 2.14 Using /dev interface to clock. Assuming hardware clock is kept in UTC time. Time elapsed since reference time has been 0.572151 seconds. Delaying further to reach the next full second. Setting Hardware Clock to 11:18:52 = 1213701532 seconds since 1969 ioctl(RTC_SET_TIME) was successful. Addresses-Debian-Bug: #478663 Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: check for ENODEVDavid Woodhouse2007-12-041-1/+1
| | | | | | | | | | | | | | /sbin/hwclock is supposed to fall back to using /dev/rtc0 if /dev/rtc isn't working (which it isn't, because mkinitrd creates it with the old device numbers, and we're switching to the new RTC_CLASS driver). Unfortunately, it'll only cope if the error it gets is ENOENT (i.e. the device node doesn't exist). It doesn't fall back to the next device in the list if the error is ENODEV, which is what happens when the device node exists, but there's no driver. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: fix --rtc optionMatthias Koenig2007-09-201-18/+15Star
| | | | | | | | | | | | | | | | | | | | | | The --rtc option does not set the name of the device correctly. It still uses /dev/rtc even if the --rtc option is given. Testcase: $ mv /dev/rtc /dev/foo $ hwclock --show --debug --rtc=/dev/foo hwclock from util-linux-2.13-rc2 Using /dev interface to clock. Last drift adjustment done at 1190198135 seconds after 1969 Last calibration done at 1190198135 seconds after 1969 Hardware clock is on local time Assuming hardware clock is kept in local time. Waiting for clock tick... hwclock: open() of /dev/rtc failed, errno=2: No such file or directory. ...got clock tick Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: remove tailing white-spaces and clean up clock.hKarel Zak2007-03-211-5/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: add support for audit systemKarel Zak2007-03-211-3/+3
| | | | | | | | | If you compile --with-audit the hwclock tool reports changes in sys/hw clock to audit system. The real long-term and final solution is probably add hooks for /dev/rtc to kernel, but it's not implemented yet. Signed-off-by: Steve Grubb <sgrubb@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: add --rtc=<path> option and support for /dev/rtc0Karel Zak2007-03-191-21/+38
| | | | | | | | | | | | The patch to allow "hwclock --rtc /dev/rtc1" and so on, since "/dev/rtc" may not be there and "/dev/rtc0" may not be the right answer either. The "--rtc" is compatible with next Bryan Henderson's hwclock versions. Signed-off-by: David Brownell <david-b@pacbell.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.13-pre1 tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.12l tarball.Karel Zak2006-12-071-0/+1
|
* Imported from util-linux-2.12a tarball.Karel Zak2006-12-071-4/+28
|
* Imported from util-linux-2.12 tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.11y tarball.Karel Zak2006-12-071-5/+4Star
|
* Imported from util-linux-2.11x tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.11t tarball.Karel Zak2006-12-071-16/+22
|
* Imported from util-linux-2.11f tarball.Karel Zak2006-12-071-113/+141
|
* Imported from util-linux-2.11b tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.10s tarball.Karel Zak2006-12-071-0/+396