Print this page
10121 smatch fix for auditstat

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/auditstat/auditstat.c
          +++ new/usr/src/cmd/auditstat/auditstat.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright (c) 2018, Joyent, Inc.
       28 + */
       29 +
  26   30  #include "statcommon.h"
  27   31  
  28   32  #include <sys/types.h>
  29   33  #include <stdlib.h>
  30   34  #include <ctype.h>
  31   35  #include <stdio.h>
  32   36  #include <bsm/audit.h>
  33   37  #include <bsm/libbsm.h>
  34   38  #include <unistd.h>
  35   39  #include <locale.h>
↓ open down ↓ 75 lines elided ↑ open up ↑
 111  115                          if (i == count - 1)
 112  116                                  break;
 113  117                  (void) sleep(interval);
 114  118          }
 115  119  
 116  120          return (0);
 117  121  }
 118  122  
 119  123  
 120  124  static void
 121      -display_stats(s, cnt)
 122      -au_stat_t *s;
      125 +display_stats(au_stat_t *s, int cnt)
 123  126  {
 124  127          int     offset[12];   /* used to line the header up correctly */
 125  128          char    buf[512];
 126  129  
 127  130          (void) sprintf(buf,
 128  131  "%4u %n%4u %n%4u %n%4u %n%4u %n%4u %n%4u %n%4u %n%4u %n%4u %n%4u %n%4u%n",
 129  132                  s->as_generated,        &(offset[0]),
 130  133                  s->as_nonattrib,        &(offset[1]),
 131  134                  s->as_kernel,           &(offset[2]),
 132  135                  s->as_audit,            &(offset[3]),
↓ open down ↓ 138 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX