mirror of
https://github.com/postgres/postgres.git
synced 2026-06-13 18:50:17 -04:00
Fix another buglet in archive_waldump.c.
While re-reading 860359ea0, I noticed another problem: when
spilling to a temp file, it did not bother to check the result
of fclose(). This is bad since write errors (like ENOSPC)
may not be reported until close time.
This commit is contained in:
parent
860359ea02
commit
69c57466a7
1 changed files with 3 additions and 1 deletions
|
|
@ -510,7 +510,9 @@ get_archive_wal_entry(const char *fname, XLogDumpPrivate *privateInfo)
|
|||
/* Write out the completed WAL file contents to a temp file. */
|
||||
write_fp = prepare_tmp_write(entry->fname, privateInfo);
|
||||
perform_tmp_write(entry->fname, entry->buf, write_fp);
|
||||
fclose(write_fp);
|
||||
if (fclose(write_fp) != 0)
|
||||
pg_fatal("could not close file \"%s/%s\": %m",
|
||||
TmpWalSegDir, entry->fname);
|
||||
|
||||
/* resetStringInfo won't release storage, so delete/recreate. */
|
||||
destroyStringInfo(entry->buf);
|
||||
|
|
|
|||
Loading…
Reference in a new issue