tool/CommandFoeWrite.cpp
changeset 1870 0cee1fb7f0fd
parent 1869 14f634f5b613
child 1968 4f682084c643
child 1991 15d656ef81af
--- a/tool/CommandFoeWrite.cpp	Thu Mar 11 15:03:52 2010 +0100
+++ b/tool/CommandFoeWrite.cpp	Thu Mar 11 15:17:25 2010 +0100
@@ -82,7 +82,6 @@
 
 void CommandFoeWrite::execute(const StringVector &args)
 {
-	MasterIndexList masterIndices;
     stringstream err;
     ec_ioctl_slave_foe_t data;
     ifstream file;
@@ -94,13 +93,6 @@
         throwInvalidUsageException(err);
     }
 
-	masterIndices = getMasterIndices();
-    if (masterIndices.size() != 1) {
-        err << getName() << " requires to select a single master!";
-        throwInvalidUsageException(err);
-    }
-    MasterDevice m(masterIndices.front());
-
     if (args[0] == "-") {
         loadFoeData(&data, cin);
         if (getOutputFile().empty()) {
@@ -128,6 +120,7 @@
         }
     }
 
+    MasterDevice m(getSingleMasterIndex());
     try {
         m.open(MasterDevice::ReadWrite);
     } catch (MasterDeviceException &e) {