[BusyBox] Re: busybox-cvs Digest, Vol 12, Issue 16

Vladimir N. Oleynik dzo at simtreas.ru
Mon Mar 22 13:54:05 UTC 2004


I wrote:

> Robert,
> 
>> Modified Files:
>>     hwclock.c Log Message:
>> The utc variable was not modified according to the -u/-l command line 
>> parameters.
> 
> 
> But you make locatime more priority.
> Regular hwclock have show error if both specified:
> 
> $ hwclock -u --localtime
> hwclock: The --utc and --localtime options are mutually exclusive.  You 
> specified both.
> 
> I think, may be this manualy patch more correct and more size optimaly:
> 
> -        int utc = 0;
> +        int utc;
> 
> -        bb_opt_complementaly = "r~ws:w~rs:s~wr";
> +        bb_opt_complementaly = "r~ws:w~rs:s~wr:l~u:u~l";
> 
> 
> -        /* If -u or -l wasnt give check if we are using utc */
> -        if (opt & HWCLOCK_OPT_UTC) {
> -                utc = 1;
> -        }
> -        else if (opt & HWCLOCK_OPT_LOCALTIME) {
> -                utc = 0;
> -        }
> -        else {
> -                utc = check_utc();
> -        }
> +    utc = opt & HWCLOCK_OPT_UTC;

OOPS. And

+	if((opt & (HWCLOCK_OPT_LOCALTIME|HWCLOCK_OPT_UTC)) == 0)
+		utc = check_utc();



--w
vodz






More information about the busybox mailing list