Bug 5114 - [patch] hwclock -s -u always load tz.tz_minuteswest = 0 in linux kernel
Summary: [patch] hwclock -s -u always load tz.tz_minuteswest = 0 in linux kernel
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-18 11:10 UTC by Peter Kosyh
Modified: 2012-04-18 11:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
patch (594 bytes, application/octet-stream)
2012-04-18 11:10 UTC, Peter Kosyh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kosyh 2012-04-18 11:10:04 UTC
Created attachment 4286 [details]
patch

Due to the bug in hwclock.c
hwclock -s -u is always load 0 tz in linux kernel.

The problem is here:
static void to_sys_clock(const char **pp_rtcname, int utc)
{
        struct timeval tv;
        struct timezone tz;
/* here timezone in uclibc is not initialized */
        tz.tz_minuteswest = timezone/60 - 60*daylight;
        tz.tz_dsttime = 0;
        tv.tv_sec = read_rtc(pp_rtcname, NULL, utc);
/* after read_rtc timezone is initialized, because of tzset(), wich is called from rtc.c, but it's too late :( */


So, here is simple patch thats works for me.