Ticket #201: pass.diff

File pass.diff, 1.0 KB (added by dnelson, 10 years ago)
  • os_freebsd.cpp

    bool get_dev_names_cam(std::vector<std::string> & 
    17701770      } else if (ccb.cdm.matches[i].type == DEV_MATCH_PERIPH &&
    17711771          (skip_device == 0 || show_all)) {
    17721772        /* One device may be populated as many peripherals (pass0 & da0 for example).
    1773         * We are searching for latest name
     1773        * We are searching for best name
    17741774        */
    17751775        periph_result =  &ccb.cdm.matches[i].result.periph_result;
    1776         devname = strprintf("%s%s%d", _PATH_DEV, periph_result->periph_name, periph_result->unit_number);
     1776        /* Prefer non-"pass" names */
     1777        if (devname.empty() || strncmp(periph_result->periph_name, "pass", 4) != 0) {
     1778          devname = strprintf("%s%s%d", _PATH_DEV, periph_result->periph_name, periph_result->unit_number);
     1779            }
    17771780        changed = 0;
    17781781      };
    17791782      if ((changed == 1 || show_all) && !devname.empty()) {