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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ipf/tools/ippool.c
          +++ new/usr/src/cmd/ipf/tools/ippool.c
   1    1  /*
   2    2   * Copyright (C) 2003 by Darren Reed.
   3    3   *
   4    4   * See the IPFILTER.LICENCE file for details on licencing.
   5    5   *
   6    6   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
   7    7   * Use is subject to license terms.
   8    8   *
   9    9   * Copyright (c) 2014, Joyent, Inc.  All rights reserved.
       10 + * Copyright 2017 Gary Mills
  10   11   */
  11   12  
  12   13  #include <sys/types.h>
  13   14  #include <sys/time.h>
  14   15  #include <sys/param.h>
  15   16  #include <sys/socket.h>
  16   17  #if defined(BSD) && (BSD >= 199306)
  17   18  # include <sys/cdefs.h>
  18   19  #endif
  19   20  #include <sys/ioctl.h>
↓ open down ↓ 355 lines elided ↑ open up ↑
 375  376          return 0;
 376  377  }
 377  378  
 378  379  
 379  380  int poollist(argc, argv)
 380  381  int argc;
 381  382  char *argv[];
 382  383  {
 383  384          char *kernel, *core, *poolname;
 384  385          int c, role, type, live_kernel;
 385      -        ip_pool_stat_t *plstp, plstat;
 386      -        iphtstat_t *htstp, htstat;
      386 +        ip_pool_stat_t *plstp;
      387 +        ip_pool_stat_t  plstat;
      388 +        iphtstat_t  htstat;
 387  389          iphtable_t *hptr;
 388  390          iplookupop_t op;
 389  391          ip_pool_t *ptr;
 390  392  
 391  393          core = NULL;
 392  394          kernel = NULL;
 393  395          live_kernel = 1;
 394  396          type = IPLT_ALL;
 395  397          poolname = NULL;
 396  398          role = IPL_LOGALL;
↓ open down ↓ 65 lines elided ↑ open up ↑
 462  464                  op.iplo_name[sizeof(op.iplo_name) - 1] = '\0';
 463  465          }
 464  466          op.iplo_unit = role;
 465  467  
 466  468          if (live_kernel == 0) {
 467  469                  poollist_dead(role, poolname, type, kernel, core);
 468  470                  return (0);
 469  471          }
 470  472  
 471  473          if (type == IPLT_ALL || type == IPLT_POOL) {
 472      -                plstp = &plstat;
 473  474                  op.iplo_type = IPLT_POOL;
 474  475                  op.iplo_size = sizeof(plstat);
 475  476                  op.iplo_struct = &plstat;
 476  477                  op.iplo_name[0] = '\0';
 477  478                  op.iplo_arg = 0;
 478  479  
 479  480                  if (role != IPL_LOGALL) {
 480  481                          op.iplo_unit = role;
 481  482  
 482  483                          c = ioctl(fd, SIOCLOOKUPSTAT, &op);
↓ open down ↓ 13 lines elided ↑ open up ↑
 496  497                                          return -1;
 497  498                                  }
 498  499  
 499  500                                  showpools_live(fd, role, &plstat, poolname, opts);
 500  501                          }
 501  502  
 502  503                          role = IPL_LOGALL;
 503  504                  }
 504  505          }
 505  506          if (type == IPLT_ALL || type == IPLT_HASH) {
 506      -                htstp = &htstat;
 507  507                  op.iplo_type = IPLT_HASH;
 508  508                  op.iplo_size = sizeof(htstat);
 509  509                  op.iplo_struct = &htstat;
 510  510                  op.iplo_name[0] = '\0';
 511  511                  op.iplo_arg = 0;
 512  512  
 513  513                  if (role != IPL_LOGALL) {
 514  514                          op.iplo_unit = role;
 515  515  
 516  516                          c = ioctl(fd, SIOCLOOKUPSTAT, &op);
↓ open down ↓ 118 lines elided ↑ open up ↑
 635  635                  (void) printpool_live(&pool, fd, poolname, opts);
 636  636  
 637  637                  plstp->ipls_list[role] = pool.ipo_next;
 638  638          }
 639  639  }
 640  640  
 641  641  int poolstats(argc, argv)
 642  642  int argc;
 643  643  char *argv[];
 644  644  {
 645      -        int c, type, role, live_kernel;
      645 +        int c, type, role;
 646  646          ip_pool_stat_t plstat;
 647      -        char *kernel, *core;
 648  647          iphtstat_t htstat;
 649  648          iplookupop_t op;
 650  649  
 651      -        core = NULL;
 652      -        kernel = NULL;
 653      -        live_kernel = 1;
 654  650          type = IPLT_ALL;
 655  651          role = IPL_LOGALL;
 656  652  
 657  653          bzero((char *)&op, sizeof(op));
 658  654  
 659  655          while ((c = getopt(argc, argv, "dG:M:N:o:t:vz:")) != -1)
 660  656                  switch (c)
 661  657                  {
 662  658                  case 'd' :
 663  659                          opts |= OPT_DEBUG;
 664  660                          break;
 665  661                  case 'G' :
 666  662                          setzonename_global(optarg);
 667  663                          break;
 668  664                  case 'M' :
 669      -                        live_kernel = 0;
 670      -                        core = optarg;
 671  665                          break;
 672  666                  case 'N' :
 673      -                        live_kernel = 0;
 674      -                        kernel = optarg;
 675  667                          break;
 676  668                  case 'o' :
 677  669                          role = getrole(optarg);
 678  670                          if (role == IPL_LOGNONE) {
 679  671                                  fprintf(stderr, "unknown role '%s'\n", optarg);
 680  672                                  return -1;
 681  673                          }
 682  674                          break;
 683  675                  case 't' :
 684  676                          type = gettype(optarg, NULL);
↓ open down ↓ 224 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX