From cdedde039c4a5656b991234a1f60cee038bd0d46 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 17 Jun 2008 13:12:12 +0200 Subject: hwclock: always reads hardware clock 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 --- hwclock/rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hwclock/rtc.c') diff --git a/hwclock/rtc.c b/hwclock/rtc.c index 46a5b5258..2acde81ef 100644 --- a/hwclock/rtc.c +++ b/hwclock/rtc.c @@ -163,7 +163,7 @@ do_rtc_read_ioctl(int rtc_fd, struct tm *tm) { perror(ioctlname); fprintf(stderr, _("ioctl() to %s to read the time failed.\n"), rtc_dev_name); - hwclock_exit(EX_IOERR); + return -1; } tm->tm_isdst = -1; /* don't know whether it's dst */ -- cgit v1.2.3-55-g7522