diff options
author | Kay Sievers <kay@vrfy.org> | 2012-09-17 16:41:13 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-09-17 16:56:26 +0200 |
commit | 72edcff5db936e54cfc322d9392ec46e2428fd9b (patch) | |
tree | 2de5e6ba1b02e2b6db42ad3ab99c0907cfcf6285 /src/timedate/timedated.c | |
parent | 4096d6f5879aef73e20dd7b62a01f447629945b0 (diff) |
hwclock: always set the kernel's timezone
Properly tell the kernel at bootup, and any later time zone changes,
the actual system time zone.
Things like the kernel's FAT filesystem driver needs the actual time
zone to calculate the proper local time to use for the on-disk time
stamps.
https://bugzilla.redhat.com/show_bug.cgi?id=802198
Diffstat (limited to 'src/timedate/timedated.c')
-rw-r--r-- | src/timedate/timedated.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index 7eed31c477..0ebece893f 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -696,13 +696,13 @@ static DBusHandlerResult timedate_message_handler( return bus_send_error_reply(connection, message, NULL, r); } + /* 2. Tell the kernel our time zone */ + hwclock_set_timezone(NULL); + if (tz.local_rtc) { struct timespec ts; struct tm *tm; - /* 2. Teach kernel new timezone */ - hwclock_apply_localtime_delta(NULL); - /* 3. Sync RTC from system clock, with the new delta */ assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0); assert_se(tm = localtime(&ts.tv_sec)); @@ -753,11 +753,8 @@ static DBusHandlerResult timedate_message_handler( return bus_send_error_reply(connection, message, NULL, r); } - /* 2. Teach kernel new timezone */ - if (tz.local_rtc) - hwclock_apply_localtime_delta(NULL); - else - hwclock_reset_localtime_delta(); + /* 2. Tell the kernel our time zone */ + hwclock_set_timezone(NULL); /* 3. Synchronize clocks */ assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0); |