summaryrefslogtreecommitdiffstats
path: root/sys-utils/hwclock-rtc.c
diff options
context:
space:
mode:
authorJ William Piggott2017-07-24 02:16:03 +0200
committerJ William Piggott2017-07-31 22:10:47 +0200
commit1d5cffa16a0183175684809cf215294ec20b8fd9 (patch)
tree284c92819af85fcbedfa38d05b20c60553da508a /sys-utils/hwclock-rtc.c
parenthwclock: squash custom errno strings (diff)
downloadkernel-qcow2-util-linux-1d5cffa16a0183175684809cf215294ec20b8fd9.tar.gz
kernel-qcow2-util-linux-1d5cffa16a0183175684809cf215294ec20b8fd9.tar.xz
kernel-qcow2-util-linux-1d5cffa16a0183175684809cf215294ec20b8fd9.zip
hwclock: fix unimplemented ioctl test
The rtc driver has not returned EINVAL for unimplemented ioctls since v2.5.8 in 2002. However, it does return it for other errors; making the current test potentially problematic. Since 9f3d0fc util-linux assumes kernel >= 2.6.0 so remove EINVAL as an ioctl test. Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'sys-utils/hwclock-rtc.c')
-rw-r--r--sys-utils/hwclock-rtc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c
index 36ce39761..ea8357daf 100644
--- a/sys-utils/hwclock-rtc.c
+++ b/sys-utils/hwclock-rtc.c
@@ -257,7 +257,7 @@ static int synchronize_to_clock_tick_rtc(const struct hwclock_control *ctl)
* they should.
*/
rc = -1;
- errno = EINVAL;
+ errno = ENOTTY;
#else
rc = ioctl(rtc_fd, RTC_UIE_ON, 0);
#endif
@@ -293,7 +293,7 @@ static int synchronize_to_clock_tick_rtc(const struct hwclock_control *ctl)
if (rc == -1)
warn(_("ioctl() to %s to turn off update interrupts failed"),
rtc_dev_name);
- } else if (errno == ENOTTY || errno == EINVAL) {
+ } else if (errno == ENOTTY) {
/*
* This rtc device doesn't have interrupt functions.
* This is typical on an Alpha, where the Hardware