summaryrefslogtreecommitdiffstats
path: root/sys-utils/hwclock-rtc.c
diff options
context:
space:
mode:
authorJ William Piggott2017-07-24 18:11:28 +0200
committerJ William Piggott2017-07-31 22:10:47 +0200
commit0411a57e25b9554cc81ce5dc183046bbb2c25810 (patch)
treeadccebd46f9b5df1f2d077fede1aee3b2dbd486e /sys-utils/hwclock-rtc.c
parenthwclock: fix unimplemented ioctl test (diff)
downloadkernel-qcow2-util-linux-0411a57e25b9554cc81ce5dc183046bbb2c25810.tar.gz
kernel-qcow2-util-linux-0411a57e25b9554cc81ce5dc183046bbb2c25810.tar.xz
kernel-qcow2-util-linux-0411a57e25b9554cc81ce5dc183046bbb2c25810.zip
hwclock: remove custom errno string
Custom errno messages are unnecessary and problematic for translators. The current messages are also too long, > 90 columns: /dev/rtc0 does not have interrupt functions. Waiting in loop for time from \ /dev/rtc0 to change Fixed: ioctl(3, RTC_UIE_ON, 0): Inappropriate ioctl for device Waiting in loop for time from /dev/rtc0 to change Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'sys-utils/hwclock-rtc.c')
-rw-r--r--sys-utils/hwclock-rtc.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c
index ea8357daf..c73807665 100644
--- a/sys-utils/hwclock-rtc.c
+++ b/sys-utils/hwclock-rtc.c
@@ -194,8 +194,11 @@ static int do_rtc_read_ioctl(int rtc_fd, struct tm *tm)
}
/*
- * Wait for the top of a clock tick by reading /dev/rtc in a busy loop until
- * we see it.
+ * Wait for the top of a clock tick by reading /dev/rtc in a busy loop
+ * until we see it. This function is used for rtc drivers without ioctl
+ * interrupts. This is typical on an Alpha, where the Hardware Clock
+ * interrupts are used by the kernel for the system clock, so aren't at
+ * the user's disposal.
*/
static int busywait_for_rtc_clock_tick(const struct hwclock_control *ctl,
const int rtc_fd)
@@ -206,9 +209,12 @@ static int busywait_for_rtc_clock_tick(const struct hwclock_control *ctl,
int rc;
struct timeval begin, now;
- if (ctl->debug)
+ if (ctl->debug) {
+ printf("ioctl(%d, RTC_UIE_ON, 0): %s\n",
+ rtc_fd, strerror(errno));
printf(_("Waiting in loop for time from %s to change\n"),
rtc_dev_name);
+ }
rc = do_rtc_read_ioctl(rtc_fd, &start_time);
if (rc)
@@ -294,19 +300,11 @@ static int synchronize_to_clock_tick_rtc(const struct hwclock_control *ctl)
warn(_("ioctl() to %s to turn off update interrupts failed"),
rtc_dev_name);
} else if (errno == ENOTTY) {
- /*
- * This rtc device doesn't have interrupt functions.
- * This is typical on an Alpha, where the Hardware
- * Clock interrupts are used by the kernel for the
- * system clock, so aren't at the user's disposal.
- */
- if (ctl->debug)
- printf(_("%s does not have interrupt functions. "),
- rtc_dev_name);
+ /* rtc ioctl interrupts are unimplemented */
ret = busywait_for_rtc_clock_tick(ctl, rtc_fd);
} else
- warn(_("ioctl() to %s to turn on update interrupts "
- "failed unexpectedly"), rtc_dev_name);
+ warn(_("ioctl(%d, RTC_UIE_ON, 0) to %s failed"),
+ rtc_fd, rtc_dev_name);
}
return ret;
}