Print this page
8485 Remove set but unused variables in usr/src/cmd

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/usr.bin/talk/get_names.c
          +++ new/usr/src/cmd/cmd-inet/usr.bin/talk/get_names.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   *
  14   14   * When distributing Covered Code, include this CDDL HEADER in each
  15   15   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16   * If applicable, add the following below this CDDL HEADER, with the
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
       23 + * Copyright 2017 Gary Mills
  23   24   * Copyright 1997 Sun Microsystems, Inc.  All rights reserved.
  24   25   * Use is subject to license terms.
  25   26   */
  26   27  
  27   28  /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
  28   29  /*        All Rights Reserved   */
  29   30  
  30   31  /*
  31   32   * University Copyright- Copyright (c) 1982, 1986, 1988
  32   33   * The Regents of the University of California
  33   34   * All Rights Reserved
  34   35   *
  35   36   * University Acknowledgment- Portions of this document are derived from
  36   37   * software developed by the University of California, Berkeley, and its
  37   38   * contributors.
  38   39   */
  39   40  
  40      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  41      -
  42   41  #include "talk.h"
  43   42  #include "ctl.h"
  44   43  #include <locale.h>
  45   44  #include <pwd.h>
  46   45  #include <sys/systeminfo.h>
  47   46  
  48   47  char *getlogin(), *ttyname(int);
  49   48  
  50   49  extern CTL_MSG msg;
  51   50  
↓ open down ↓ 6 lines elided ↑ open up ↑
  58   57  void
  59   58  get_names(argc, argv)
  60   59  int argc;
  61   60  char *argv[];
  62   61  {
  63   62          char hostname[HOST_NAME_LENGTH + 1];
  64   63          char *rem_name;
  65   64          char *my_name;
  66   65          char *my_machine_name;
  67   66          char *rem_machine_name;
  68      -        char *my_tty;
  69   67          char *rem_tty;
  70   68          char *ptr;
  71   69          int name_length;
  72   70  
  73   71          if (argc < 2) {
  74   72                  fprintf(stderr,
  75   73                      "Usage: talk %s\n", gettext("address [terminal]"));
  76   74                  exit(1);
  77   75          }
  78   76          if (!isatty(0)) {
↓ open down ↓ 16 lines elided ↑ open up ↑
  95   93          if (my_name == NULL) {
  96   94                  fprintf(stderr,
  97   95          gettext("Who are you?  You have no entry in /etc/utmp!  Aborting..\n"));
  98   96                  exit(1);
  99   97          }
 100   98  
 101   99          name_length = HOST_NAME_LENGTH;
 102  100          (void) sysinfo(SI_HOSTNAME, hostname, name_length);
 103  101          my_machine_name = hostname;
 104  102  
 105      -        my_tty = strrchr(ttyname(0), '/') + 1;
 106      -
 107  103          /*
 108  104           * check for, and strip out, the machine name of the target
 109  105           */
 110  106  
 111  107          for (ptr = argv[1]; *ptr != '\0' &&
 112  108                           *ptr != '@' &&
 113  109                           *ptr != ':' &&
 114  110                           *ptr != '!' &&
 115  111                           *ptr != '.'; ptr++) {
 116  112          }
↓ open down ↓ 44 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX