Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5f5ba92

Browse files
author
Michael Meskes
committed
Make ecpg in line with other compilers in that it deletes its output if there was an error processing the input file.
Work done by Zoltan.
1 parenta404a12 commit5f5ba92

File tree

1 file changed

+9
-1
lines changed
  • src/interfaces/ecpg/preproc

1 file changed

+9
-1
lines changed

‎src/interfaces/ecpg/preproc/ecpg.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.114 2010/02/26 02:01:31 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.115 2010/04/03 19:30:49 meskes Exp $ */
22

33
/* Main for ecpg, the PostgreSQL embedded SQL precompiler. */
44
/* Copyright (c) 1996-2010, PostgreSQL Global Development Group */
@@ -469,6 +469,14 @@ main(int argc, char *const argv[])
469469
fclose(yyin);
470470
if (out_option==0&&yyout!=stdout)
471471
fclose(yyout);
472+
/*
473+
* If there was an error, delete the output file.
474+
*/
475+
if (ret_value!=0)
476+
{
477+
if (strcmp(output_filename,"-")!=0&&unlink(output_filename)!=0)
478+
fprintf(stderr,_("could not remove output file \"%s\"\n"),output_filename);
479+
}
472480
}
473481

474482
if (output_filename&&out_option==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp