Bug 5114

Summary: [patch] hwclock -s -u always load tz.tz_minuteswest = 0 in linux kernel
Product: Busybox Reporter: Peter Kosyh <p.kosyh>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: major CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: patch

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.