diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2004-11-09 15:57:57 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2004-11-09 15:57:57 +0000 |
commit | e9c05281b5991ad5937cc14579dfff79499d6786 (patch) | |
tree | a03b8a046cf3727660f450f8b538aafa9b4ab63c /src/interfaces/ecpg/preproc/ecpg.c | |
parent | 960f545041bc3c6a7536d4ee8328c087c52616b3 (diff) |
Get rid of perror(), substitute some better phrased error messages.
malloc() doesn't set errno, so most uses were buggy anyway.
Diffstat (limited to 'src/interfaces/ecpg/preproc/ecpg.c')
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 9d0648289cf..d106928d58b 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.90 2004/08/29 05:07:00 momjian Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.91 2004/11/09 15:57:55 petere Exp $ */ /* New main for ecpg, the PostgreSQL embedded SQL precompiler. */ /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */ @@ -154,7 +154,8 @@ main(int argc, char *const argv[]) yyout = fopen(optarg, PG_BINARY_W); if (yyout == NULL) - perror(optarg); + fprintf(stderr, "%s: could not open file \"%s\": %s\n", + progname, optarg, strerror(errno)); else out_option = 1; break; @@ -304,7 +305,8 @@ main(int argc, char *const argv[]) yyout = fopen(output_filename, PG_BINARY_W); if (yyout == NULL) { - perror(output_filename); + fprintf(stderr, "%s: could not open file \"%s\": %s\n", + progname, output_filename, strerror(errno)); free(output_filename); free(input_filename); continue; @@ -313,7 +315,8 @@ main(int argc, char *const argv[]) } if (yyin == NULL) - perror(argv[fnr]); + fprintf(stderr, "%s: could not open file \"%s\": %s\n", + progname, argv[fnr], strerror(errno)); else { struct cursor *ptr; |