[OpenWrt-Devel] [PATCH] base-files: For sysfixtime use hwclock if RTC available

Daniel Dickinson openwrt at daniel.thecshore.com
Mon Jan 11 03:31:34 EST 2016


Actually I must have been smoking something when I thought I saw that 
problem (and no I don't actually).  I think it must have been in 
combination with some other error that I misremembered.

I just checked both bash and ash (and the docs) and they 'do the right 
thing'.

Regards,

Daniel

On 11/01/16 03:19 AM, Daniel Dickinson wrote:
> Hi,
>
> On 10/01/16 06:42 AM, bittorf wireless )) Bastian Bittorf wrote:
>>> +
>>> +start() {
>>> +    if [ -e /dev/rtc ]; then
>>> +        hwclock -s
>>
>> please use the short form [ -e /dev/rtc ] && ...
>>
>
> Per private mail I've learned this is the current codebase standard, so
> will follow that, but the reason I tend to prefer the if..then is that
> if..then has the correct semantics when using set -e (that is causes
> termination on error, but not under normal operation) whereas [ xx ] &&
> yy is not set -e safe and simply adding || true results in error
> conditions not being detected, so it is actually doing the wrong thing
> if you use set -e (unless the initial condition being false is an error
> and not just normal operation).
>
> Regards,
>
> Daniel
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list