From c4db974e346100b4a30f438a9dec3e9163baade5 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Tue, 21 Aug 2007 08:56:51 +0000 Subject: * Add an explicit mode to the callto open (the default one that is used anyway). * Clarify error message. * Remove the mode parameter when opening a zap device (it is ignored anyway). Fix patgen's usage message while we're there. closes #10505 on Zaptel trunk. Merged revisions 2914 via svnmerge from https://origsvn.digium.com/svn/zaptel/branches/1.2 Merged revisions 2915 via svnmerge from https://origsvn.digium.com/svn/zaptel/branches/1.4 git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2916 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- fxotune.c | 4 ++-- patgen.c | 4 ++-- patlooptest.c | 2 +- pattest.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fxotune.c b/fxotune.c index 9e12f3a..8999010 100644 --- a/fxotune.c +++ b/fxotune.c @@ -824,10 +824,10 @@ static int do_calibrate(int startdev, int enddev, int calibtype, char* configfil char zapdev[80] = ""; struct wctdm_echo_coefs coefs; - configfd = open(configfile, O_CREAT|O_TRUNC|O_WRONLY); + configfd = open(configfile, O_CREAT|O_TRUNC|O_WRONLY, 0666); if (configfd < 0) { - fprintf(stderr, "open: %s\n", strerror(errno)); + fprintf(stderr, "Cannot generate config file %s: open: %s\n", configfile, strerror(errno)); return -1; } diff --git a/patgen.c b/patgen.c index f3f1769..8c980e1 100644 --- a/patgen.c +++ b/patgen.c @@ -37,10 +37,10 @@ int main(int argc, char *argv[]) unsigned char c=0; unsigned char outbuf[BLOCK_SIZE]; if (argc < 2) { - fprintf(stderr, "Usage: markhdlctest \n"); + fprintf(stderr, "Usage: %s \n",argv[0]); exit(1); } - fd = open(argv[1], O_RDWR, 0600); + fd = open(argv[1], O_RDWR); if (fd < 0) { fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); diff --git a/patlooptest.c b/patlooptest.c index 655d387..d1ab7e6 100644 --- a/patlooptest.c +++ b/patlooptest.c @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Usage: %s \n",argv[0]); exit(1); } - fd = open(argv[1], O_RDWR, 0600); + fd = open(argv[1], O_RDWR); if (fd < 0) { fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); diff --git a/pattest.c b/pattest.c index 1923614..d14311a 100644 --- a/pattest.c +++ b/pattest.c @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Usage: %s [optional timeout]\n",argv[0]); exit(1); } - fd = open(argv[1], O_RDWR, 0600); + fd = open(argv[1], O_RDWR); if (fd < 0) { fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); -- cgit v1.2.3