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  plstat;
      387 +        iphtstat_t  htstat;
 387  388          iphtable_t *hptr;
 388  389          iplookupop_t op;
 389  390          ip_pool_t *ptr;
 390  391  
 391  392          core = NULL;
 392  393          kernel = NULL;
 393  394          live_kernel = 1;
 394  395          type = IPLT_ALL;
 395  396          poolname = NULL;
 396  397          role = IPL_LOGALL;
↓ open down ↓ 65 lines elided ↑ open up ↑
 462  463                  op.iplo_name[sizeof(op.iplo_name) - 1] = '\0';
 463  464          }
 464  465          op.iplo_unit = role;
 465  466  
 466  467          if (live_kernel == 0) {
 467  468                  poollist_dead(role, poolname, type, kernel, core);
 468  469                  return (0);
 469  470          }
 470  471  
 471  472          if (type == IPLT_ALL || type == IPLT_POOL) {
 472      -                plstp = &plstat;
 473  473                  op.iplo_type = IPLT_POOL;
 474  474                  op.iplo_size = sizeof(plstat);
 475  475                  op.iplo_struct = &plstat;
 476  476                  op.iplo_name[0] = '\0';
 477  477                  op.iplo_arg = 0;
 478  478  
 479  479                  if (role != IPL_LOGALL) {
 480  480                          op.iplo_unit = role;
 481  481  
 482  482                          c = ioctl(fd, SIOCLOOKUPSTAT, &op);
↓ open down ↓ 13 lines elided ↑ open up ↑
 496  496                                          return -1;
 497  497                                  }
 498  498  
 499  499                                  showpools_live(fd, role, &plstat, poolname, opts);
 500  500                          }
 501  501  
 502  502                          role = IPL_LOGALL;
 503  503                  }
 504  504          }
 505  505          if (type == IPLT_ALL || type == IPLT_HASH) {
 506      -                htstp = &htstat;
 507  506                  op.iplo_type = IPLT_HASH;
 508  507                  op.iplo_size = sizeof(htstat);
 509  508                  op.iplo_struct = &htstat;
 510  509                  op.iplo_name[0] = '\0';
 511  510                  op.iplo_arg = 0;
 512  511  
 513  512                  if (role != IPL_LOGALL) {
 514  513                          op.iplo_unit = role;
 515  514  
 516  515                          c = ioctl(fd, SIOCLOOKUPSTAT, &op);
↓ open down ↓ 118 lines elided ↑ open up ↑
 635  634                  (void) printpool_live(&pool, fd, poolname, opts);
 636  635  
 637  636                  plstp->ipls_list[role] = pool.ipo_next;
 638  637          }
 639  638  }
 640  639  
 641  640  int poolstats(argc, argv)
 642  641  int argc;
 643  642  char *argv[];
 644  643  {
 645      -        int c, type, role, live_kernel;
      644 +        int c, type, role;
 646  645          ip_pool_stat_t plstat;
 647      -        char *kernel, *core;
 648  646          iphtstat_t htstat;
 649  647          iplookupop_t op;
 650  648  
 651      -        core = NULL;
 652      -        kernel = NULL;
 653      -        live_kernel = 1;
 654  649          type = IPLT_ALL;
 655  650          role = IPL_LOGALL;
 656  651  
 657  652          bzero((char *)&op, sizeof(op));
 658  653  
 659  654          while ((c = getopt(argc, argv, "dG:M:N:o:t:vz:")) != -1)
 660  655                  switch (c)
 661  656                  {
 662  657                  case 'd' :
 663  658                          opts |= OPT_DEBUG;
 664  659                          break;
 665  660                  case 'G' :
 666  661                          setzonename_global(optarg);
 667  662                          break;
 668  663                  case 'M' :
 669      -                        live_kernel = 0;
 670      -                        core = optarg;
 671  664                          break;
 672  665                  case 'N' :
 673      -                        live_kernel = 0;
 674      -                        kernel = optarg;
 675  666                          break;
 676  667                  case 'o' :
 677  668                          role = getrole(optarg);
 678  669                          if (role == IPL_LOGNONE) {
 679  670                                  fprintf(stderr, "unknown role '%s'\n", optarg);
 680  671                                  return -1;
 681  672                          }
 682  673                          break;
 683  674                  case 't' :
 684  675                          type = gettype(optarg, NULL);
↓ open down ↓ 224 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX