tools/Master.cpp
changeset 1001 a8eab75aa8e3
parent 990 4f223f3df05a
child 1029 61ffe5f22306
--- a/tools/Master.cpp	Thu Jun 12 09:32:25 2008 +0000
+++ b/tools/Master.cpp	Thu Jun 12 09:44:18 2008 +0000
@@ -266,9 +266,12 @@
     open(Read);
 
     if (domainIndex == -1) {
-        unsigned int numDomains = domainCount(), i;
-
-        for (i = 0; i < numDomains; i++) {
+        unsigned int i;
+        ec_ioctl_master_t master;
+
+        getMaster(&master);
+
+        for (i = 0; i < master.domain_count; i++) {
             outputDomainData(i);
         }
     } else {
@@ -314,9 +317,12 @@
     open(Read);
 
     if (domainIndex == -1) {
-        unsigned int numDomains = domainCount(), i;
-
-        for (i = 0; i < numDomains; i++) {
+        unsigned int i;
+        ec_ioctl_master_t master;
+
+        getMaster(&master);
+
+        for (i = 0; i < master.domain_count; i++) {
             showDomain(i);
         }
     } else {
@@ -1498,21 +1504,6 @@
 
 /****************************************************************************/
 
-unsigned int Master::domainCount()
-{
-    int ret;
-
-    if ((ret = ioctl(fd, EC_IOCTL_DOMAIN_COUNT, 0)) < 0) {
-        stringstream err;
-        err << "Failed to get number of domains: " << strerror(errno);
-        throw MasterException(err.str());
-    }
-
-    return ret;
-}
-
-/****************************************************************************/
-
 unsigned int Master::slaveCount()
 {
     ec_ioctl_master_t data;