Content-Length: 263178 | pFad | http://github.com/postgrespro/postgres/commit/07abcd9ab712b843568e2f9a00006dd25797dc02

CD Fix error reporting after ioctl() call with pg_upgrade --clone · postgrespro/postgres@07abcd9 · GitHub
Skip to content

Commit 07abcd9

Browse files
committed
Fix error reporting after ioctl() call with pg_upgrade --clone
errno was not reported correctly after attempting to clone a file, leading to incorrect error reports. While scanning through the code, I have not noticed any similar mistakes. Error introduced in 3a769d8. Author: Justin Pryzby Discussion: https://postgr.es/m/20220731134135.GY15006@telsasoft.com Backpatch-through: 12
1 parent feae5c0 commit 07abcd9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bin/pg_upgrade/file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ cloneFile(const char *src, const char *dst,
5757

5858
if (ioctl(dest_fd, FICLONE, src_fd) < 0)
5959
{
60+
int save_errno = errno;
61+
6062
unlink(dst);
6163
pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
62-
schemaName, relName, src, dst, strerror(errno));
64+
schemaName, relName, src, dst, strerror(save_errno));
6365
}
6466

6567
close(src_fd);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/07abcd9ab712b843568e2f9a00006dd25797dc02

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy