summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/preproc.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/preproc.y')
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index 80dc376582..e4bd74f38c 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -1,10 +1,11 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.344 2007/06/11 11:52:08 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.345 2007/06/11 12:01:23 meskes Exp $ */
/* Copyright comment */
%{
#include "postgres_fe.h"
#include "extern.h"
+#include <unistd.h>
/* Location tracking support --- simpler than bison's default */
#define YYLLOC_DEFAULT(Current, Rhs, N) \
@@ -101,8 +102,8 @@ mmerror(int error_code, enum errortype type, char * error, ...)
case ET_FATAL:
fclose(yyin);
fclose(yyout);
- if (unlink(output_filename) != 0)
- fprintf(stderr, "Could not remove ourput file %s!\n", output_filename);
+ if (unlink(output_filename) != 0 && *output_filename != '-')
+ fprintf(stderr, "Could not remove output file %s!\n", output_filename);
exit(error_code);
}
}