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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/hal/addons/network-devices/common.c
          +++ new/usr/src/cmd/hal/addons/network-devices/common.c
   1    1  /*
        2 + * Copyright 2017 Gary Mills
   2    3   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
   3    4   *
   4    5   * Licensed under the Academic Free License version 2.1
   5    6   */
   6    7  
   7    8  #include <stdio.h>
   8    9  #include <stdlib.h>
   9   10  #include <unistd.h>
  10   11  #include <signal.h>
  11   12  #include <string.h>
↓ open down ↓ 94 lines elided ↑ open up ↑
 106  107                  n = sprintf(buf, prefix);
 107  108          for (i = 0; ((i < (mac_len)) && (n < buf_len)); i++)
 108  109                  n += sprintf(buf + n, "%2.2X", *mac++);
 109  110  
 110  111          return (buf);
 111  112  }
 112  113  
 113  114  static char *
 114  115  pseudo_serialno_from_addr(char *name)
 115  116  {
 116      -        int sd, rc, errnum;
      117 +        int sd, errnum;
 117  118          char buf[128];
 118  119          struct hostent *hp;
 119  120          struct xarpreq ar;
 120  121  
 121  122          if (name == NULL)
 122  123                  return (NULL);
 123  124  
 124  125          memset(&ar, 0, sizeof (ar));
 125  126  
 126  127          hp = getipnodebyname(name, AF_INET6, AI_ADDRCONFIG, &errnum);
↓ open down ↓ 6 lines elided ↑ open up ↑
 133  134          } else {
 134  135                  struct sockaddr_in *sin = (struct sockaddr_in *)&ar.xarp_pa;
 135  136  
 136  137                  sin->sin_family = AF_INET;
 137  138                  sin->sin_addr.s_addr = inet_addr(name);
 138  139          }
 139  140  
 140  141          sd = socket(AF_INET, SOCK_DGRAM, 0);
 141  142  
 142  143          ar.xarp_ha.sdl_family = AF_LINK;
 143      -        rc = ioctl(sd, SIOCGXARP, (caddr_t)&ar);
      144 +        (void) ioctl(sd, SIOCGXARP, (caddr_t)&ar);
 144  145  
 145  146          close(sd);
 146  147  
 147  148          if (ar.xarp_flags & ATF_COM) {  /* use the MAC address */
 148  149                  uchar_t *ea = (uchar_t *)LLADDR(&ar.xarp_ha);
 149  150  
 150  151                  addr_to_string("LLADDR-", ea, ar.xarp_ha.sdl_alen,
 151  152                                          buf, sizeof (buf));
 152  153  
 153  154          } else if (hp != NULL) {          /* use the IPv6 address */
↓ open down ↓ 188 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX