summaryrefslogtreecommitdiff
path: root/ztscan.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-04 17:53:40 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-04 17:53:40 +0000
commitc3aa97c3e7b22c795481134efc9a215a677d0165 (patch)
tree97948c33528978b469d50f9e08b7215ddd2e7097 /ztscan.c
parent3dbc15f0ecbfd225b5b05bb1c66524b82e21380f (diff)
eliminate the 'general' section from the ztscan output, as it doesn't contain anything the GUI needs and one user is concerned about the 'totalspans' number having to be kept in sync if the output is edited
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3291 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'ztscan.c')
-rw-r--r--ztscan.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/ztscan.c b/ztscan.c
index dbad8f4..1ca0574 100644
--- a/ztscan.c
+++ b/ztscan.c
@@ -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);
}