summaryrefslogtreecommitdiffstats
path: root/hwclock/rtc.c
diff options
context:
space:
mode:
authorDavid Woodhouse2007-12-04 14:44:05 +0100
committerKarel Zak2007-12-04 14:44:05 +0100
commitdf1d7dcf1eafe37732adedd160d31354d6d7de9d (patch)
tree9997a15035578267f1050f69fa29f2dc0b6484b5 /hwclock/rtc.c
parentsfdisk: allow partitioning drives of over 2^31 sectors. (diff)
downloadkernel-qcow2-util-linux-df1d7dcf1eafe37732adedd160d31354d6d7de9d.tar.gz
kernel-qcow2-util-linux-df1d7dcf1eafe37732adedd160d31354d6d7de9d.tar.xz
kernel-qcow2-util-linux-df1d7dcf1eafe37732adedd160d31354d6d7de9d.zip
hwclock: check for ENODEV
/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>
Diffstat (limited to 'hwclock/rtc.c')
-rw-r--r--hwclock/rtc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hwclock/rtc.c b/hwclock/rtc.c
index 724daf99e..46a5b5258 100644
--- a/hwclock/rtc.c
+++ b/hwclock/rtc.c
@@ -113,7 +113,7 @@ open_rtc(void) {
for (p=fls; *p; ++p) {
int fd = open(*p, O_RDONLY);
- if (fd < 0 && errno == ENOENT)
+ if (fd < 0 && (errno == ENOENT || errno == ENODEV))
continue;
rtc_dev_name = *p;
return fd;