Print this page
4378 Clean up %C in *time() functions
438 need documentation for strftime %s flag

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/gen/cftime.c
          +++ new/usr/src/lib/libc/port/gen/cftime.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  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   22  /*
       23 + * Copyright (c) 2014 Gary Mills
       24 + *
  23   25   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   26   * Use is subject to license terms.
  25   27   */
  26   28  
  27   29  /*      Copyright (c) 1988 AT&T */
  28   30  /*        All Rights Reserved   */
  29   31  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   32  /*
  33   33   * This routine converts time as follows.  The epoch is 0000  Jan  1
  34   34   * 1970  GMT.   The  argument  time  is  in seconds since then.  The
  35   35   * localtime(t) entry returns a pointer to an array containing:
  36   36   *
  37   37   *                seconds (0-59)
  38   38   *                minutes (0-59)
  39   39   *                hours (0-23)
  40   40   *                day of month (1-31)
  41   41   *                month (0-11)
↓ open down ↓ 42 lines elided ↑ open up ↑
  84   84          /* LINTED do not use ascftime() */
  85   85          return (ascftime(buf, format, p));
  86   86  }
  87   87  
  88   88  int
  89   89  ascftime(char *buf, const char *format, const struct tm *tm)
  90   90  {
  91   91          /* Set format string, if not already set */
  92   92          if (format == NULL || *format == '\0')
  93   93                  if (((format = getenv("CFTIME")) == 0) || *format == 0)
  94      -                        format =  "%C";
       94 +                        format =  "%+";
  95   95  
  96   96          return ((int)strftime(buf, LONG_MAX, format, tm));
  97   97  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX