Print this page
4337 eliminate /etc/TIMEZONE

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/bnu/uucico.c
          +++ new/usr/src/cmd/bnu/uucico.c
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
       22 + * Copyright 2014 Garrett D'Amore
       23 + */
       24 +/*
  22   25   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   26   * Use is subject to license terms.
  24   27   */
  25   28  
  26   29  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   30  /*        All Rights Reserved   */
  28   31  
  29   32  
  30   33  /*
  31   34  
↓ open down ↓ 878 lines elided ↑ open up ↑
 910  913  void
 911  914  setTZ()
 912  915  {
 913  916          static char     buf[LINELEN], *bp;
 914  917          extern char     *fgets();
 915  918          FILE            *tzfp;
 916  919          extern FILE     *fopen();
 917  920          int             i;
 918  921          extern int      fclose(), strncmp();
 919  922  
 920      -        if ( (tzfp = fopen("/etc/TIMEZONE","r")) == (FILE *)NULL )
      923 +        if ( (tzfp = fopen("/etc/default/init","r")) == (FILE *)NULL )
 921  924                  return;
 922  925          while ( (bp = fgets(buf,LINELEN,tzfp)) != (char *)NULL ) {
 923  926                  while ( isspace(*bp) )
 924  927                          ++bp;
 925  928                  if ( strncmp(bp, "TZ=", 3) == 0 ) {
 926  929                          for ( i = strlen(bp) - 1; i > 0 && isspace(*(bp+i)); --i )
 927  930                                  *(bp+i) = '\0';
 928  931                          putenv(bp);
 929  932                          (void)fclose(tzfp);
 930  933                          return;
↓ open down ↓ 80 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX