Print this page
6139 help gcc figure out variable initialization

Split Close
Expand all
Collapse all
          --- old/usr/src/common/iscsit/iscsit_common.c
          +++ new/usr/src/common/iscsit/iscsit_common.c
↓ open down ↓ 817 lines elided ↑ open up ↑
 818  818  
 819  819                  while (ptr && (i < tpg->tpg_portal_count)) {
 820  820                          ret = sockaddr_to_str(&(ptr->portal_addr),
 821  821                              &(portalArray[i]));
 822  822                          if (ret != 0) {
 823  823                                  break;
 824  824                          }
 825  825                          ptr = ptr->portal_next;
 826  826                          i++;
 827  827                  }
 828      -        }
 829  828  
 830      -        if ((ret == 0) && portalArray) {
 831      -                ret = nvlist_add_string_array(*nvl, "portalList",
 832      -                    portalArray, i);
 833      -        }
      829 +                if (ret == 0) {
      830 +                        ret = nvlist_add_string_array(*nvl, "portalList",
      831 +                            portalArray, i);
      832 +                }
 834  833  
 835  834  
 836      -        if (portalArray) {
 837  835                  while (--i >= 0) {
 838  836                          if (portalArray[i]) {
 839  837                                  iscsit_free(portalArray[i],
 840  838                                      strlen(portalArray[i] + 1));
 841  839                          }
 842  840                  }
 843  841                  iscsit_free(portalArray,
 844  842                      tpg->tpg_portal_count * sizeof (it_portal_t));
 845  843          }
 846  844  
↓ open down ↓ 737 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX