aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_upgrade/file.c')
-rw-r--r--src/bin/pg_upgrade/file.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/bin/pg_upgrade/file.c b/src/bin/pg_upgrade/file.c
index b84868c7510..c2ca99dcd86 100644
--- a/src/bin/pg_upgrade/file.c
+++ b/src/bin/pg_upgrade/file.c
@@ -40,25 +40,25 @@ cloneFile(const char *src, const char *dst,
{
#if defined(HAVE_COPYFILE) && defined(COPYFILE_CLONE_FORCE)
if (copyfile(src, dst, NULL, COPYFILE_CLONE_FORCE) < 0)
- pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
+ pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
schemaName, relName, src, dst, strerror(errno));
#elif defined(__linux__) && defined(FICLONE)
int src_fd;
int dest_fd;
if ((src_fd = open(src, O_RDONLY | PG_BINARY, 0)) < 0)
- pg_fatal("error while cloning relation \"%s.%s\": could not open file \"%s\": %s\n",
+ pg_fatal("error while cloning relation \"%s.%s\": could not open file \"%s\": %s",
schemaName, relName, src, strerror(errno));
if ((dest_fd = open(dst, O_RDWR | O_CREAT | O_EXCL | PG_BINARY,
pg_file_create_mode)) < 0)
- pg_fatal("error while cloning relation \"%s.%s\": could not create file \"%s\": %s\n",
+ pg_fatal("error while cloning relation \"%s.%s\": could not create file \"%s\": %s",
schemaName, relName, dst, strerror(errno));
if (ioctl(dest_fd, FICLONE, src_fd) < 0)
{
unlink(dst);
- pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
+ pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
schemaName, relName, src, dst, strerror(errno));
}
@@ -84,12 +84,12 @@ copyFile(const char *src, const char *dst,
char *buffer;
if ((src_fd = open(src, O_RDONLY | PG_BINARY, 0)) < 0)
- pg_fatal("error while copying relation \"%s.%s\": could not open file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not open file \"%s\": %s",
schemaName, relName, src, strerror(errno));
if ((dest_fd = open(dst, O_RDWR | O_CREAT | O_EXCL | PG_BINARY,
pg_file_create_mode)) < 0)
- pg_fatal("error while copying relation \"%s.%s\": could not create file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not create file \"%s\": %s",
schemaName, relName, dst, strerror(errno));
/* copy in fairly large chunks for best efficiency */
@@ -103,7 +103,7 @@ copyFile(const char *src, const char *dst,
ssize_t nbytes = read(src_fd, buffer, COPY_BUF_SIZE);
if (nbytes < 0)
- pg_fatal("error while copying relation \"%s.%s\": could not read file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not read file \"%s\": %s",
schemaName, relName, src, strerror(errno));
if (nbytes == 0)
@@ -115,7 +115,7 @@ copyFile(const char *src, const char *dst,
/* if write didn't set errno, assume problem is no disk space */
if (errno == 0)
errno = ENOSPC;
- pg_fatal("error while copying relation \"%s.%s\": could not write file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not write file \"%s\": %s",
schemaName, relName, dst, strerror(errno));
}
}
@@ -129,7 +129,7 @@ copyFile(const char *src, const char *dst,
if (CopyFile(src, dst, true) == 0)
{
_dosmaperr(GetLastError());
- pg_fatal("error while copying relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
+ pg_fatal("error while copying relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
schemaName, relName, src, dst, strerror(errno));
}
@@ -148,7 +148,7 @@ linkFile(const char *src, const char *dst,
const char *schemaName, const char *relName)
{
if (link(src, dst) < 0)
- pg_fatal("error while creating link for relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
+ pg_fatal("error while creating link for relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
schemaName, relName, src, dst, strerror(errno));
}
@@ -187,16 +187,16 @@ rewriteVisibilityMap(const char *fromfile, const char *tofile,
rewriteVmBytesPerPage = (BLCKSZ - SizeOfPageHeaderData) / 2;
if ((src_fd = open(fromfile, O_RDONLY | PG_BINARY, 0)) < 0)
- pg_fatal("error while copying relation \"%s.%s\": could not open file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not open file \"%s\": %s",
schemaName, relName, fromfile, strerror(errno));
if (fstat(src_fd, &statbuf) != 0)
- pg_fatal("error while copying relation \"%s.%s\": could not stat file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not stat file \"%s\": %s",
schemaName, relName, fromfile, strerror(errno));
if ((dst_fd = open(tofile, O_RDWR | O_CREAT | O_EXCL | PG_BINARY,
pg_file_create_mode)) < 0)
- pg_fatal("error while copying relation \"%s.%s\": could not create file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not create file \"%s\": %s",
schemaName, relName, tofile, strerror(errno));
/* Save old file size */
@@ -220,10 +220,10 @@ rewriteVisibilityMap(const char *fromfile, const char *tofile,
if ((bytesRead = read(src_fd, buffer.data, BLCKSZ)) != BLCKSZ)
{
if (bytesRead < 0)
- pg_fatal("error while copying relation \"%s.%s\": could not read file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not read file \"%s\": %s",
schemaName, relName, fromfile, strerror(errno));
else
- pg_fatal("error while copying relation \"%s.%s\": partial page found in file \"%s\"\n",
+ pg_fatal("error while copying relation \"%s.%s\": partial page found in file \"%s\"",
schemaName, relName, fromfile);
}
@@ -298,7 +298,7 @@ rewriteVisibilityMap(const char *fromfile, const char *tofile,
/* if write didn't set errno, assume problem is no disk space */
if (errno == 0)
errno = ENOSPC;
- pg_fatal("error while copying relation \"%s.%s\": could not write file \"%s\": %s\n",
+ pg_fatal("error while copying relation \"%s.%s\": could not write file \"%s\": %s",
schemaName, relName, tofile, strerror(errno));
}
@@ -325,7 +325,7 @@ check_file_clone(void)
#if defined(HAVE_COPYFILE) && defined(COPYFILE_CLONE_FORCE)
if (copyfile(existing_file, new_link_file, NULL, COPYFILE_CLONE_FORCE) < 0)
- pg_fatal("could not clone file between old and new data directories: %s\n",
+ pg_fatal("could not clone file between old and new data directories: %s",
strerror(errno));
#elif defined(__linux__) && defined(FICLONE)
{
@@ -333,23 +333,23 @@ check_file_clone(void)
int dest_fd;
if ((src_fd = open(existing_file, O_RDONLY | PG_BINARY, 0)) < 0)
- pg_fatal("could not open file \"%s\": %s\n",
+ pg_fatal("could not open file \"%s\": %s",
existing_file, strerror(errno));
if ((dest_fd = open(new_link_file, O_RDWR | O_CREAT | O_EXCL | PG_BINARY,
pg_file_create_mode)) < 0)
- pg_fatal("could not create file \"%s\": %s\n",
+ pg_fatal("could not create file \"%s\": %s",
new_link_file, strerror(errno));
if (ioctl(dest_fd, FICLONE, src_fd) < 0)
- pg_fatal("could not clone file between old and new data directories: %s\n",
+ pg_fatal("could not clone file between old and new data directories: %s",
strerror(errno));
close(src_fd);
close(dest_fd);
}
#else
- pg_fatal("file cloning not supported on this platform\n");
+ pg_fatal("file cloning not supported on this platform");
#endif
unlink(new_link_file);
@@ -367,7 +367,7 @@ check_hard_link(void)
if (link(existing_file, new_link_file) < 0)
pg_fatal("could not create hard link between old and new data directories: %s\n"
- "In link mode the old and new data directories must be on the same file system.\n",
+ "In link mode the old and new data directories must be on the same file system.",
strerror(errno));
unlink(new_link_file);