pg_upgrade errno

Justin Pryzby <pryzby@telsasoft.com>

From: Justin Pryzby <pryzby@telsasoft.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Date: 2022-07-31T13:41:35Z
Lists: pgsql-hackers
Since 3a769d823 (pg_upgrade: Allow use of file cloning)
file.c has had:

-       if (ioctl(dest_fd, FICLONE, src_fd) < 0)
-       {
-               unlink(dst);
-               pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
-                                schemaName, relName, src, dst, strerror(errno));
-       }

But errno should be saved before strerror/%m.

-- 
Justin



Commits

  1. Fix error reporting after ioctl() call with pg_upgrade --clone