pg90-delete-on-error.patch
text/x-patch
Filename: pg90-delete-on-error.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| src/interfaces/ecpg/preproc/ecpg.c | 8 | 0 |
*** pgsql/src/interfaces/ecpg/preproc/ecpg.c~ 2010-04-03 18:15:53.000000000 +0200
--- pgsql/src/interfaces/ecpg/preproc/ecpg.c 2010-04-03 18:15:53.000000000 +0200
***************
*** 469,474 ****
--- 469,482 ----
fclose(yyin);
if (out_option == 0 && yyout != stdout)
fclose(yyout);
+ /*
+ * If there was an error, delete the output file.
+ */
+ if (ret_value != 0)
+ {
+ if (strcmp(output_filename, "-") != 0 && unlink(output_filename) != 0)
+ fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
+ }
}
if (output_filename && out_option == 0)