diff options
author | Karel Zak | 2018-08-03 13:08:21 +0200 |
---|---|---|
committer | Karel Zak | 2018-08-03 13:08:21 +0200 |
commit | 0dcb713f2e2fe34756bab3c28e4d4ddec47afe1f (patch) | |
tree | 38e6206f16a9ec8f6f1eb81bb13e39378c906c09 /sys-utils/hwclock-rtc.c | |
parent | mesg: do not print 'ttyname failed' message unless --verbose requested (diff) | |
download | kernel-qcow2-util-linux-0dcb713f2e2fe34756bab3c28e4d4ddec47afe1f.tar.gz kernel-qcow2-util-linux-0dcb713f2e2fe34756bab3c28e4d4ddec47afe1f.tar.xz kernel-qcow2-util-linux-0dcb713f2e2fe34756bab3c28e4d4ddec47afe1f.zip |
hwclock: rely on kernel for RTC_UIE_ON on Aplha and Sparc
It's kernel business to return EINVAL for unsupported RTC_UIE_ON. We
(userspace) should not make decisions about things that we do not
control.
If kernel is wrong then fix the kernel, don't hide the problem by
crazy ifdefs in userspace.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/hwclock-rtc.c')
-rw-r--r-- | sys-utils/hwclock-rtc.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c index 3b069d7aa..32feb3504 100644 --- a/sys-utils/hwclock-rtc.c +++ b/sys-utils/hwclock-rtc.c @@ -253,18 +253,9 @@ static int synchronize_to_clock_tick_rtc(const struct hwclock_control *ctl) warn(_("cannot open rtc device")); return ret; } else { - int rc; /* Return code from ioctl */ /* Turn on update interrupts (one per second) */ -#if defined(__alpha__) || defined(__sparc__) - /* - * Not all alpha kernels reject RTC_UIE_ON, but probably - * they should. - */ - rc = -1; - errno = EINVAL; -#else - rc = ioctl(rtc_fd, RTC_UIE_ON, 0); -#endif + int rc = ioctl(rtc_fd, RTC_UIE_ON, 0); + if (rc != -1) { /* * Just reading rtc_fd fails on broken hardware: no |