]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: revert ioctl test
authorKarel Zak <kzak@redhat.com>
Thu, 23 Nov 2017 09:30:27 +0000 (10:30 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 23 Nov 2017 09:30:27 +0000 (10:30 +0100)
This commit reverts 1d5cffa16a0183175684809cf215294ec20b8fd9.

(I did this revert manually as there was another changes in the code
and git-revert does not work in this case.)

Addresses: https://github.com/karelzak/util-linux/issues/543
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/hwclock-rtc.c

index 62e432937028b5ed17b9d8016da2bca146479adb..cdd7d80d604d3839b578655a049270a9e68340f2 100644 (file)
@@ -261,7 +261,7 @@ static int synchronize_to_clock_tick_rtc(const struct hwclock_control *ctl)
                 * they should.
                 */
                rc = -1;
-               errno = ENOTTY;
+               errno = EINVAL;
 #else
                rc = ioctl(rtc_fd, RTC_UIE_ON, 0);
 #endif
@@ -296,7 +296,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) {
+               } else if (errno == ENOTTY || errno == EINVAL) {
                        /* rtc ioctl interrupts are unimplemented */
                        ret = busywait_for_rtc_clock_tick(ctl, rtc_fd);
                } else