From 039a0ceccf11f293ce9db96cc9f556f861505e6e Mon Sep 17 00:00:00 2001 From: J William Piggott Date: Mon, 17 Apr 2017 18:39:56 -0400 Subject: hwclock: make epoch functions alpha only It's been 19.1315 years since the comment below was written and the kernel has actually gone further away from allowing an RTC epoch on ISA machines. /* * Maintenance note: This should work on non-Alpha machines, but the * evidence today (98.03.04) indicates that the kernel only keeps the epoch * value on Alphas. If that is ever fixed, this function should be changed. */ The current behavior is to accept the epoch options on ISA machines only to print a lengthy message explaining that you cannot use them. This patch removes that behavior, making the epoch functions truly Alpha only, as the man-page states that they are. * sys-utils/hwclock.c: make epoch function alpha only. * sys-utils/hwclock.h: same. Signed-off-by: J William Piggott --- sys-utils/hwclock.c | 61 ++++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 38 deletions(-) (limited to 'sys-utils/hwclock.c') diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index 10436f287..0c587957d 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -1162,28 +1162,11 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time, return 0; } -/* - * Get or set the Hardware Clock epoch value in the kernel, as appropriate. - * , , and are hwclock invocation options. - * - * == -1 if the user did not specify an "epoch" option. - */ -#ifdef __linux__ -/* - * Maintenance note: This should work on non-Alpha machines, but the - * evidence today (98.03.04) indicates that the kernel only keeps the epoch - * value on Alphas. If that is ever fixed, this function should be changed. +/** + * Get or set the kernel RTC driver's epoch on Alpha machines. + * ISA machines are hard coded for 1900. */ -# ifndef __alpha__ -static void -manipulate_epoch(const struct hwclock_control *ctl __attribute__((__unused__))) -{ - warnx(_("The kernel keeps an epoch value for the Hardware Clock " - "only on an Alpha machine.\nThis copy of hwclock was built for " - "a machine other than Alpha\n(and thus is presumably not running " - "on an Alpha now). No action taken.")); -} -# else +#if defined(__linux__) && defined(__alpha__) static void manipulate_epoch(const struct hwclock_control *ctl) { @@ -1210,8 +1193,7 @@ manipulate_epoch(const struct hwclock_control *ctl) ("Unable to set the epoch value in the kernel.\n")); } } -# endif /* __alpha__ */ -#endif /* __linux__ */ +#endif /* __linux__ __alpha__ */ static void out_version(void) { @@ -1251,7 +1233,7 @@ static void usage(const struct hwclock_control *ctl, const char *fmt, ...) " --systz set the system time based on the current timezone\n" " --adjust adjust the RTC to account for systematic drift since\n" " the clock was last set or adjusted\n"), usageto); -#ifdef __linux__ +#if defined(__linux__) && defined(__alpha__) fputs(_(" --getepoch print out the kernel's hardware clock epoch value\n" " --setepoch set the kernel's hardware clock epoch value to the \n" " value given with --epoch\n"), usageto); @@ -1267,9 +1249,10 @@ static void usage(const struct hwclock_control *ctl, const char *fmt, ...) #endif fprintf(usageto, _( " --directisa access the ISA bus directly instead of %s\n" - " --date