summaryrefslogtreecommitdiffstats
path: root/sys-utils
diff options
context:
space:
mode:
authorJ William Piggott2017-07-31 17:57:01 +0200
committerJ William Piggott2017-08-04 14:53:45 +0200
commit4a6f658cb2a881832a4f38385452c427605057b9 (patch)
tree293ebdd1f36050504281bece919b2c5421853fb7 /sys-utils
parenthwclock: restore select() timeout warning (diff)
downloadkernel-qcow2-util-linux-4a6f658cb2a881832a4f38385452c427605057b9.tar.gz
kernel-qcow2-util-linux-4a6f658cb2a881832a4f38385452c427605057b9.tar.xz
kernel-qcow2-util-linux-4a6f658cb2a881832a4f38385452c427605057b9.zip
hwclock: remove busywait tristate return status
The select() synchronization branch only returns success or fail. There is no reason for the busywait branch to do more. If synchronization fails for any reason then it must exit, otherwise all drift correction operation will be invalid. Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'sys-utils')
-rw-r--r--sys-utils/hwclock-rtc.c11
-rw-r--r--sys-utils/hwclock.h6
2 files changed, 5 insertions, 12 deletions
diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c
index a660e32ba..c50011aec 100644
--- a/sys-utils/hwclock-rtc.c
+++ b/sys-utils/hwclock-rtc.c
@@ -216,9 +216,8 @@ static int busywait_for_rtc_clock_tick(const struct hwclock_control *ctl,
rtc_dev_name);
}
- rc = do_rtc_read_ioctl(rtc_fd, &start_time);
- if (rc)
- return RTC_BUSYWAIT_FAILED;
+ if (do_rtc_read_ioctl(rtc_fd, &start_time))
+ return 1;
/*
* Wait for change. Should be within a second, but in case
@@ -233,13 +232,13 @@ static int busywait_for_rtc_clock_tick(const struct hwclock_control *ctl,
gettimeofday(&now, NULL);
if (time_diff(now, begin) > 1.5) {
warnx(_("Timed out waiting for time change."));
- return RTC_BUSYWAIT_TIMEOUT;
+ return 1;
}
} while (1);
if (rc)
- return RTC_BUSYWAIT_FAILED;
- return RTC_BUSYWAIT_OK;
+ return 1;
+ return 0;
}
/*
diff --git a/sys-utils/hwclock.h b/sys-utils/hwclock.h
index 8843501f3..6943d8d79 100644
--- a/sys-utils/hwclock.h
+++ b/sys-utils/hwclock.h
@@ -9,12 +9,6 @@
#include "c.h"
-enum {
- RTC_BUSYWAIT_OK = 0,
- RTC_BUSYWAIT_FAILED,
- RTC_BUSYWAIT_TIMEOUT
-};
-
struct hwclock_control {
char *date_opt;
char *adj_file_name;