diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-04-17 10:01:22 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-04-17 10:01:22 +0900 |
commit | 9010156445c420361c2cef9557751c0b8b52644b (patch) | |
tree | 818e9d0a08ca21b286914dceb140bfb238040f2b /src | |
parent | 47ac2033d460cefbbda2e39732e18de521dc6a36 (diff) | |
download | postgresql-9010156445c420361c2cef9557751c0b8b52644b.tar.gz postgresql-9010156445c420361c2cef9557751c0b8b52644b.zip |
Fix thinko introduced by 82a5649 in slot.c
When saving a replication slot, failing to close the temporary path used
to save the slot information is considered as a failure and reported as
such. However the code forgot to leave immediately as other failure
paths do.
Noticed while looking up at this area of the code for another patch.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/replication/slot.c | 3 |
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) |