summaryrefslogtreecommitdiff
path: root/fxotune.c
diff options
context:
space:
mode:
Diffstat (limited to 'fxotune.c')
-rwxr-xr-xfxotune.c13
1 files changed, 10 insertions, 3 deletions
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;
}