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

@@ -21,10 +21,11 @@
  */
 /*
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  * Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright 2017 Gary Mills
  */
 
 #include <sys/types.h>
 #include <sys/errno.h>
 #include <sys/tiuser.h>

@@ -291,26 +292,24 @@
  *  put service and control type in the xid cache.
  */
 void
 extract_rpcsec_gss_cred_info(int xid)
 {
-        unsigned int seq_num;
         unsigned int handle_len;
-        unsigned int flavor_len;
         unsigned int rpcsec_gss_ver;
         rpc_gss_service_t rpcsec_gss_service;
         unsigned int rpcsec_gss_proc;
         struct cache_struct *x;
 
-        flavor_len = getxdr_u_long();
+        (void) getxdr_u_long();
         rpcsec_gss_ver = getxdr_u_long();
         /* see if we know this version or not */
         if (rpcsec_gss_ver != 1) {
                 longjmp(xdr_err, 1);
         }
         rpcsec_gss_proc   = getxdr_u_long();
-        seq_num    = getxdr_u_long();
+        (void) getxdr_u_long();
         rpcsec_gss_service    = getxdr_enum();
         /* skip the handle */
         xdr_skip(RNDUP(getxdr_u_long()));
 
         if (x = find_xid(xid)) {

@@ -325,11 +324,11 @@
  */
 static void
 print_rpc_gss_init_arg(int flags, struct cache_struct *x)
 {
 
-        char *token, *line;
+        char  *line;
         unsigned int token_len;
         int pos = 0;
 
         /*
          *  see if we need to print out the rpc_gss_init_arg structure

@@ -346,11 +345,11 @@
         (void) sprintf(get_line(pos, getxdr_pos()),
             "RPCSEC_GSS_INIT args:");
 
         pos = getxdr_pos();
         token_len = getxdr_u_long();
-        token = getxdr_hex(token_len);
+        (void) getxdr_hex(token_len);
         line = get_line(pos, getxdr_pos());
         sprintf(line, "   gss token: length = %d, data = [%d bytes]",
             token_len, token_len);
 
         show_trailer();

@@ -361,11 +360,11 @@
  */
 void
 print_rpc_gss_init_res(int flags)
 {
 
-        char *handle, *token, *line;
+        char *handle, *line;
         unsigned int token_len, handle_len;
         unsigned int major, minor, seq_window;
 
         int pos = 0;
         struct cache_struct *x;

@@ -393,11 +392,11 @@
 
         (void) sprintf(get_line(pos, getxdr_pos()),
             "   sequence window  = %u", seq_window);
         pos = getxdr_pos();
         token_len = getxdr_u_long();
-        token = getxdr_hex(token_len);
+        (void) getxdr_hex(token_len);
         line = get_line(pos, getxdr_pos());
         sprintf(line, "   gss token: length = %d, data = [%d bytes]",
             token_len, token_len);
         show_trailer();
 }