summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-07-21 20:28:27 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-07-21 20:28:27 +0200
commitff4daf5a348278abed4dbf8afc3c4297b8cb9877 (patch)
treea9940950447c6ed8b4412d2bb4201df449d9fff1 /src/main.c
parentf68c5a70762da0cbb6228d05a87254a7c6c46ba6 (diff)
fix hwclock_apply_localtime_delta() to properly handle negative TZ offset
Localtime may be a negative number, i.e. GMT-7. Fix based on a patch from Kelly Anderson <kelly@silka.with-linux.com>.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 0bcd09c4cf..0a99e5a916 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1056,11 +1056,11 @@ int main(int argc, char *argv[]) {
goto finish;
if (hwclock_is_localtime() > 0) {
- int min;
+ int err, min;
- min = hwclock_apply_localtime_delta();
- if (min < 0)
- log_error("Failed to apply local time delta: %s", strerror(-min));
+ err = hwclock_apply_localtime_delta(&min);
+ if (err < 0)
+ log_error("Failed to apply local time delta: %s", strerror(-err));
else
log_info("RTC configured in localtime, applying delta of %i minutes to system time.", min);
}