From 44c67fd3692d61cf24fcbc76045bccf096220c3c Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 17 Jan 2005 17:20:33 +0000 Subject: Working out a few bugs. Should be usable now. git-svn-id: http://svn.digium.com/svn/zaptel/trunk@564 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- fxotune.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'fxotune.c') diff --git a/fxotune.c b/fxotune.c index 434d2d6..29eaa3b 100755 --- a/fxotune.c +++ b/fxotune.c @@ -226,13 +226,15 @@ int main (int argc , char **argv) } if (!strcasecmp(argv[1], "-s")) { + FILE *fp = NULL; + + fp = fopen(configfile, "r"); + for (i = 0;res != EOF; i++) { struct wctdm_echo_coefs mycoefs; char completezappath[56] = ""; int myzap,myacim,mycoef1,mycoef2,mycoef3,mycoef4,mycoef5,mycoef6,mycoef7,mycoef8; - FILE *fp = NULL; - fp = fopen(configfile, "r"); res = fscanf(fp, "%d=%d,%d,%d,%d,%d,%d,%d,%d,%d",&myzap,&myacim,&mycoef1, &mycoef2,&mycoef3,&mycoef4,&mycoef5,&mycoef6,&mycoef7, @@ -274,8 +276,13 @@ int main (int argc , char **argv) fprintf(stdout, "%s: %s\n", completezappath, strerror(errno)); return -1; } + + close(fd); } + + fclose(fp); + fprintf(stdout, "fxotune: successfully set echo coeffecients on FXO modules\n"); return 0; } @@ -288,7 +295,7 @@ int main (int argc , char **argv) configfd = open(configfile, O_CREAT|O_TRUNC|O_WRONLY); if (configfd < 0) { - fprintf(stdout, "open: %s\n", strerror(errno)); + fprintf(stderr, "open: %s\n", strerror(errno)); return -1; } -- cgit v1.2.3