Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 88a7c48

Browse files
author
Michael Meskes
committed
Should not try to unlink stdout.
1 parent 91411b6 commit 88a7c48

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,4 +2203,9 @@ Sun, 27 May 2007 13:14:39 +0200
22032203

22042204
- Changed variable test to not run into infinite loops on backend
22052205
errors.
2206+
2207+
Mon, 11 Jun 2007 13:59:57 +0200
2208+
2209+
- Fixed memory leak in descriptor code.
2210+
- Made ecpg delete output file in case of an error.
22062211
- Set ecpg version to 4.3.1.

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.344 2007/06/11 11:52:08 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.345 2007/06/11 12:01:23 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
55
#include "postgres_fe.h"
66

77
#include "extern.h"
8+
#include <unistd.h>
89

910
/* Location tracking support --- simpler than bison's default */
1011
#define YYLLOC_DEFAULT(Current, Rhs, N) \
@@ -101,8 +102,8 @@ mmerror(int error_code, enum errortype type, char * error, ...)
101102
case ET_FATAL:
102103
fclose(yyin);
103104
fclose(yyout);
104-
if (unlink(output_filename) != 0)
105-
fprintf(stderr, "Could not remove ourput file %s!\n", output_filename);
105+
if (unlink(output_filename) != 0 && *output_filename != '-')
106+
fprintf(stderr, "Could not remove output file %s!\n", output_filename);
106107
exit(error_code);
107108
}
108109
}

0 commit comments

Comments
 (0)