Print this page
10142 smatch fix for who

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/who/who.c
          +++ new/usr/src/cmd/who/who.c
↓ open down ↓ 22 lines elided ↑ open up ↑
  23   23  
  24   24  
  25   25  /*
  26   26   * Copyright (c) 2013 Gary Mills
  27   27   *
  28   28   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  29   29   * Use is subject to license terms.
  30   30   */
  31   31  
  32   32  /*
       33 + * Copyright (c) 2018, Joyent, Inc.
       34 + */
       35 +
       36 +/*
  33   37   *      This program analyzes information found in /var/adm/utmpx
  34   38   *
  35   39   *      Additionally information is gathered from /etc/inittab
  36   40   *      if requested.
  37   41   *
  38   42   *
  39   43   *      Syntax:
  40   44   *
  41   45   *              who am i        Displays info on yourself
  42   46   *
↓ open down ↓ 250 lines elided ↑ open up ↑
 293  297                          break;
 294  298                  }
 295  299          }
 296  300  #ifdef  XPG4
 297  301          /*
 298  302           * XCU4 changes - check for illegal sopt, Topt & aopt combination
 299  303           */
 300  304          if (sopt == 1) {
 301  305                  terse = 1;
 302  306                  if (Topt == 1 || aopt == 1)
 303      -                goerr++;
      307 +                        goerr++;
 304  308          }
 305  309  #endif  /* XPG4 */
 306  310  
 307  311          if (goerr > 0) {
 308  312  #ifdef  XPG4
 309  313                  /*
 310  314                   * XCU4 - slightly different usage with -s -a & -T
 311  315                   */
 312  316                  (void) fprintf(stderr, gettext("\nUsage:\t%s"), program);
 313  317                  (void) fprintf(stderr,
↓ open down ↓ 377 lines elided ↑ open up ↑
 691  695          if (utmpp->ut_type == BOOT_TIME) {
 692  696                  if (optcnt == 1 && !validtype[USER_PROCESS]) {
 693  697                          (void) printf("\n");
 694  698                          exit(0);
 695  699                  }
 696  700          }
 697  701  
 698  702          /*
 699  703           *      Get remote host from utmpx structure
 700  704           */
 701      -        if (utmpp && utmpp->ut_host[0])
      705 +        if (utmpp->ut_host[0])
 702  706                  (void) printf("\t(%.*s)", sizeof (utmpp->ut_host),
 703  707                      utmpp->ut_host);
 704  708  
 705  709          /*
 706  710           *      Now, put on the trailing EOL
 707  711           */
 708  712          (void) printf("\n");
 709  713  }
 710  714  
 711  715  static void
↓ open down ↓ 158 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX