cvs commit: CVSROOT cfg_local.pm

Ken Smith kensmith at cse.Buffalo.EDU
Tue Jun 8 15:14:36 GMT 2004


On Mon, Jun 07, 2004 at 11:16:14PM -0400, Garrett Wollman wrote:
> [Moving this discussion to -standards.]
> 
> <<On Mon, 7 Jun 2004 22:47:46 -0400, Ken Smith <kensmith at cse.Buffalo.EDU> said:
> 
> > It sounds like it would be better for the system to say "UTC" instead
> > of "GMT" in the absence of /etc/localtime.  Does anyone disagree?
> 
> I don't think POSIX reaches this question.  It says that there shall
> be a default timezone used when the TZ variable is not set, but
> doesn't say how this is established or what it should be, so I'm fine
> with that.  (But it will be a challenge to find the right bits in
> localtime.c to frob in order to make it happen, as I just found when I
> looked.)
> 

Believe it or not, if we don't mind all the mention of GMT in the
file and all the functions/variables being named "gmt<something>" then I
think this is all that's needed:

Index: localtime.c
===================================================================
RCS file: /home/ncvs/src/lib/libc/stdtime/localtime.c,v
retrieving revision 1.36
diff -u -r1.36 localtime.c
--- localtime.c 16 Feb 2003 17:29:11 -0000      1.36
+++ localtime.c 8 Jun 2004 04:49:30 -0000
@@ -70,7 +70,7 @@
  
 static char            wildabbr[] = "WILDABBR";
  
-static const char      gmt[] = "GMT";
+static const char      gmt[] = "UTC";
  
 struct ttinfo {                                /* time type information */
        long            tt_gmtoff;      /* GMT offset in seconds */

--------------------------

It seems to be working:

breathed 25 % uname -a
FreeBSD breathed.cse.buffalo.edu 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Tue Jun  8 06:59:48 EDT 2004     root at breathed.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  sparc64
breathed 26 % date
Tue Jun  8 15:04:49 UTC 2004
breathed 27 % setenv TZ GMT
breathed 28 % date
Tue Jun  8 15:04:55 GMT 2004
breathed 29 % setenv TZ EST5EDT
breathed 30 % date
Tue Jun  8 11:05:08 EDT 2004
breathed 31 % unsetenv TZ
breathed 32 % date
Tue Jun  8 15:05:13 UTC 2004
breathed 33 %
--------------------------

I'm new to changes like this...  Has this been brought up in enough
places to proceed in a few days (give people a bit more time to decide
to complain)?

-- 
						Ken Smith
- From there to here, from here to      |       kensmith at cse.buffalo.edu
  there, funny things are everywhere.   |
                      - Theodore Geisel |


More information about the freebsd-standards mailing list