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

@@ -5,10 +5,11 @@
  *
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
  * Copyright (c) 2014, Joyent, Inc.  All rights reserved.
+ * Copyright 2017 Gary Mills
  */
 
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/param.h>

@@ -380,12 +381,13 @@
 int argc;
 char *argv[];
 {
         char *kernel, *core, *poolname;
         int c, role, type, live_kernel;
-        ip_pool_stat_t *plstp, plstat;
-        iphtstat_t *htstp, htstat;
+        ip_pool_stat_t *plstp;
+        ip_pool_stat_t  plstat;
+        iphtstat_t  htstat;
         iphtable_t *hptr;
         iplookupop_t op;
         ip_pool_t *ptr;
 
         core = NULL;

@@ -467,11 +469,10 @@
                 poollist_dead(role, poolname, type, kernel, core);
                 return (0);
         }
 
         if (type == IPLT_ALL || type == IPLT_POOL) {
-                plstp = &plstat;
                 op.iplo_type = IPLT_POOL;
                 op.iplo_size = sizeof(plstat);
                 op.iplo_struct = &plstat;
                 op.iplo_name[0] = '\0';
                 op.iplo_arg = 0;

@@ -501,11 +502,10 @@
 
                         role = IPL_LOGALL;
                 }
         }
         if (type == IPLT_ALL || type == IPLT_HASH) {
-                htstp = &htstat;
                 op.iplo_type = IPLT_HASH;
                 op.iplo_size = sizeof(htstat);
                 op.iplo_struct = &htstat;
                 op.iplo_name[0] = '\0';
                 op.iplo_arg = 0;

@@ -640,19 +640,15 @@
 
 int poolstats(argc, argv)
 int argc;
 char *argv[];
 {
-        int c, type, role, live_kernel;
+        int c, type, role;
         ip_pool_stat_t plstat;
-        char *kernel, *core;
         iphtstat_t htstat;
         iplookupop_t op;
 
-        core = NULL;
-        kernel = NULL;
-        live_kernel = 1;
         type = IPLT_ALL;
         role = IPL_LOGALL;
 
         bzero((char *)&op, sizeof(op));
 

@@ -664,16 +660,12 @@
                         break;
                 case 'G' :
                         setzonename_global(optarg);
                         break;
                 case 'M' :
-                        live_kernel = 0;
-                        core = optarg;
                         break;
                 case 'N' :
-                        live_kernel = 0;
-                        kernel = optarg;
                         break;
                 case 'o' :
                         role = getrole(optarg);
                         if (role == IPL_LOGNONE) {
                                 fprintf(stderr, "unknown role '%s'\n", optarg);