Subject: Re: bin/36831: rtclocaltime shows negative 0
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, zafer@aydogan.de>
From: Alan Barrett <apb@cequrux.com>
List: netbsd-bugs
Date: 08/24/2007 17:20:04
The following reply was made to PR bin/36831; it has been noted by GNATS.
From: Alan Barrett <apb@cequrux.com>
To: gnats-bugs@NetBSD.org
Cc: netbsd-bugs@NetBSD.org
Subject: Re: bin/36831: rtclocaltime shows negative 0
Date: Fri, 24 Aug 2007 19:17:17 +0200
On Fri, 24 Aug 2007, zafer@aydogan.de wrote:
> when using rtclocaltime=no in rc.conf and when /etc/localtime links to
> UTC (default), then rc.d prints during boot:
>
> Setting RTC offset to -0.
This is caused by an awk bug, which is reproducible like this:
echo foo | awk '{print (-1 * 0)}'
# prints "-0"; should print "0".
> The patch fixes this. No functional changes, just cosmetics showing 0
> without a negative sign.
Your patch happens to work around the awk bug, but makes the shell script
much harder to understand.
--apb (Alan Barrett)