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/print/libpapi-common/common/attribute.c
          +++ new/usr/src/lib/print/libpapi-common/common/attribute.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  
  28   30  /* $Id: attribute.c 157 2006-04-26 15:07:55Z ktou $ */
  29   31  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   32  /*LINTLIBRARY*/
  33   33  
  34   34  #include <stdio.h>
  35   35  #include <stdlib.h>
  36   36  #include <stdarg.h>
  37   37  #include <string.h>
  38   38  #include <ctype.h>
  39   39  #include <alloca.h>
  40   40  #include <papi.h>
  41   41  #include <regex.h>
↓ open down ↓ 908 lines elided ↑ open up ↑
 950  950                                                          ? 'c' : 'i'));
 951  951                          rc = strlcat(buffer, string, buflen);
 952  952                          }
 953  953                          break;
 954  954                  case PAPI_DATETIME: {
 955  955                          struct tm *tm = localtime(&values[i]->datetime);
 956  956  
 957  957                          if (tm != NULL) {
 958  958                                  char string[64];
 959  959  
 960      -                                strftime(string, sizeof (string), "%C", tm);
      960 +                                strftime(string, sizeof (string), "%c", tm);
 961  961                                  rc = strlcat(buffer, string, buflen);
 962  962                          }}
 963  963                          break;
 964  964                  case PAPI_COLLECTION: {
 965  965                          char *string = alloca(buflen);
 966  966  
 967  967                          papiAttributeListToString(values[i]->collection,
 968  968                                          delim, string, buflen);
 969  969                          rc = strlcat(buffer, string, buflen);
 970  970                          }
↓ open down ↓ 149 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX