aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_upgrade/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/pg_upgrade/file.c b/src/bin/pg_upgrade/file.c
index c7fed24df93..76d18e9f094 100644
--- a/src/bin/pg_upgrade/file.c
+++ b/src/bin/pg_upgrade/file.c
@@ -62,9 +62,11 @@ cloneFile(const char *src, const char *dst,
if (ioctl(dest_fd, FICLONE, src_fd) < 0)
{
+ int save_errno = errno;
+
unlink(dst);
pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
- schemaName, relName, src, dst, strerror(errno));
+ schemaName, relName, src, dst, strerror(save_errno));
}
close(src_fd);