From 72edcff5db936e54cfc322d9392ec46e2428fd9b Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Mon, 17 Sep 2012 16:41:13 +0200 Subject: 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 --- src/timedate/timedated.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/timedate/timedated.c') 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); -- cgit v1.2.3-54-g00ecf