diff options
-rw-r--r-- | ztscan.c | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -44,12 +44,10 @@ int main(int argc, char *argv[]) { int ctl; int x, y; - int hasgeneral = 0; struct zt_params params; unsigned int basechan = 1; struct zt_spaninfo s; char buf[100]; - int totalspans = ZT_MAX_SPANS; char alarms[50]; if ((ctl = open("/dev/zap/ctl", O_RDWR)) < 0) { @@ -57,18 +55,12 @@ int main(int argc, char *argv[]) exit(1); } - for (x = 1; x < totalspans; x++) { + for (x = 1; x < ZT_MAX_SPANS; x++) { memset(&s, 0, sizeof(s)); s.spanno = x; if (ioctl(ctl, ZT_SPANSTAT, &s)) continue; - if (!hasgeneral) { - fprintf(stdout, "[general]\ntotalspans=%d\n", s.totalspans); - hasgeneral++; - totalspans = s.totalspans; - } - alarms[0] = '\0'; if (s.alarms) { if (s.alarms & ZT_ALARM_BLUE) @@ -174,8 +166,5 @@ int main(int argc, char *argv[]) basechan += s.totalchans; } - if (!hasgeneral) - fprintf(stdout, "[general]\ntotalspans=0\nerror=No Spans Found\n"); - exit(0); } |