[BusyBox-cvs] [BusyBox 0000074]: hwclock arguments -u and -l inverted

bugs at busybox.net bugs at busybox.net
Sat Jul 16 22:19:17 UTC 2005


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=74 
====================================================================== 
Reported By:                ralphs
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   74
Category:                   Standards Compliance
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-01-2005 11:35 PST
Last Modified:              07-16-2005 15:19 PDT
====================================================================== 
Summary:                    hwclock arguments -u and -l inverted
Description: 
Given a system with RTC that has the time programmed in UTC, and /etc/TZ
contains EST5EDT... then the following work as expected

# date
Tue Feb  1 14:23:29 EST 2005
# date -u
Tue Feb  1 19:23:30 UTC 2005

The hwclock utility seems to mix up the two cases:
# hwclock
Tue Feb  1 19:22:17 2005  0.000000 seconds
# hwclock -u
Tue Feb  1 14:22:29 2005  0.000000 seconds
# hwclock -l
Tue Feb  1 19:22:44 2005  0.000000 seconds

Normally "hwclock" with no argument prints local time, and with "-u"
should print UTC.  The "-l" option fails to print local time.  Also "-l"
does not exist in the regular hwclock program.

====================================================================== 

---------------------------------------------------------------------- 
 ralphs - 02-01-05 12:33  
---------------------------------------------------------------------- 
Seems to be platform dependant as well.  The above report was on PPC
target; doing the same on an x86 host behaves a little differently- the
localtime output is correct, but the UTC times are reported with 2x the
time zone applied, eg instead of UTC-5 it prints out UTC-10. 

---------------------------------------------------------------------- 
 vapier - 04-15-05 21:47  
---------------------------------------------------------------------- 
instead of looking at `date`, look at the behavior compared to the normal
`hwclock`:

$ ./busybox hwclock -u ; hwclock -u
Fri Apr 15 19:48:55 2005  0.000000 seconds
Fri Apr 15 19:48:56 2005  -0.997188 seconds
$ ./busybox hwclock -l ; hwclock --localtime
Fri Apr 15 23:49:09 2005  0.000000 seconds
Fri Apr 15 23:49:10 2005  -0.840237 seconds

in other words, behavior looks fine to me ? 

---------------------------------------------------------------------- 
 pgf - 07-16-05 15:19  
---------------------------------------------------------------------- 
The only bug that i see is that with no arguments, the busybox hwclock
applet returns a different value than the system hwclock command (on
systems using
UTC in the RTC).

the busybox applet tries to open and parse /var/lib/hwclock/adjtime --
why
does it assume this file exists?  if the file doesn't exist, it assumes
UTC
is not in use in the rtc. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-01-05 11:35  ralphs         New Issue                                    
02-01-05 12:33  ralphs         Note Added: 0000031                          
03-16-05 12:27  andersen       Assigned To              andersen => BusyBox 
04-15-05 21:47  vapier         Note Added: 0000154                          
07-16-05 15:19  pgf            Note Added: 0000296                          
======================================================================




More information about the busybox-cvs mailing list