aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/slot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 057c5d7ab2e..55c306e4654 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -1316,10 +1316,13 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
pgstat_report_wait_end();
if (CloseTransientFile(fd))
+ {
ereport(elevel,
(errcode_for_file_access(),
errmsg("could not close file \"%s\": %m",
tmppath)));
+ return;
+ }
/* rename to permanent file, fsync file and directory */
if (rename(tmppath, path) != 0)