Open master device as late as possible.

This commit is contained in:
Florian Pose
2010-03-11 15:03:52 +01:00
parent fb8a75570d
commit ddaee8a1fc
27 changed files with 154 additions and 107 deletions

View File

@@ -70,6 +70,7 @@ string CommandCStruct::helpString() const
void CommandCStruct::execute(const StringVector &args)
{
MasterIndexList masterIndices;
SlaveList slaves;
SlaveList::const_iterator si;
@@ -79,9 +80,10 @@ void CommandCStruct::execute(const StringVector &args)
throwInvalidUsageException(err);
}
masterIndices = getMasterIndices();
MasterIndexList::const_iterator mi;
for (mi = getMasterIndices().begin();
mi != getMasterIndices().end(); mi++) {
for (mi = masterIndices.begin();
mi != masterIndices.end(); mi++) {
MasterDevice m(*mi);
m.open(MasterDevice::Read);
slaves = selectedSlaves(m);