Skip to content
Snippets Groups Projects
Commit c5782a25 authored by Florian Pose's avatar Florian Pose
Browse files

Be more tolerant when selecting slaves and domains.

parent 47e5e9d6
No related branches found
No related tags found
No related merge requests found
...@@ -339,8 +339,10 @@ Command::SlaveList Command::selectedSlaves(MasterDevice &m) ...@@ -339,8 +339,10 @@ Command::SlaveList Command::selectedSlaves(MasterDevice &m)
NumberListParser::List::const_iterator pi; NumberListParser::List::const_iterator pi;
for (pi = posList.begin(); pi != posList.end(); pi++) { for (pi = posList.begin(); pi != posList.end(); pi++) {
m.getSlave(&slave, *pi); if (*pi < master.slave_count) {
list.push_back(slave); m.getSlave(&slave, *pi);
list.push_back(slave);
}
} }
} else { // aliases given } else { // aliases given
SlaveAliasParser ap(master, m); SlaveAliasParser ap(master, m);
...@@ -375,11 +377,6 @@ Command::SlaveList Command::selectedSlaves(MasterDevice &m) ...@@ -375,11 +377,6 @@ Command::SlaveList Command::selectedSlaves(MasterDevice &m)
for (pi = posList.begin(); pi != posList.end(); pi++) { for (pi = posList.begin(); pi != posList.end(); pi++) {
if (*pi < aliasSlaves.size()) { if (*pi < aliasSlaves.size()) {
list.push_back(aliasSlaves[*pi]); list.push_back(aliasSlaves[*pi]);
} else {
stringstream err;
err << "Warning: Slave " << *ai << ":" << *pi
<< " does not exist on master " << m.getIndex();
throwCommandException(err);
} }
} }
} }
...@@ -475,9 +472,11 @@ Command::DomainList Command::selectedDomains(MasterDevice &m) ...@@ -475,9 +472,11 @@ Command::DomainList Command::selectedDomains(MasterDevice &m)
NumberListParser::List::const_iterator di; NumberListParser::List::const_iterator di;
for (di = domList.begin(); di != domList.end(); di++) { for (di = domList.begin(); di != domList.end(); di++) {
ec_ioctl_domain_t d; if (*di < master.domain_count) {
m.getDomain(&d, *di); ec_ioctl_domain_t d;
list.push_back(d); m.getDomain(&d, *di);
list.push_back(d);
}
} }
return list; return list;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment