#ifndef WIN32
-static int copy_file(const char *fromfile, const char *tofile, bool force);
+static int copy_file(const char *fromfile, const char *tofile);
#else
static int win32_pghardlink(const char *src, const char *dst);
#endif
* Copies a relation file from src to dst.
*/
const char *
-copyFile(const char *src, const char *dst, bool force)
+copyFile(const char *src, const char *dst)
{
#ifndef WIN32
- if (copy_file(src, dst, force) == -1)
+ if (copy_file(src, dst) == -1)
#else
- if (CopyFile(src, dst, !force) == 0)
+ if (CopyFile(src, dst, true) == 0)
#endif
return getErrorText();
else
#ifndef WIN32
static int
-copy_file(const char *srcfile, const char *dstfile, bool force)
+copy_file(const char *srcfile, const char *dstfile)
{
#define COPY_BUF_SIZE (50 * BLCKSZ)
if ((src_fd = open(srcfile, O_RDONLY, 0)) < 0)
return -1;
- if ((dest_fd = open(dstfile, O_RDWR | O_CREAT | (force ? 0 : O_EXCL), S_IRUSR | S_IWUSR)) < 0)
+ if ((dest_fd = open(dstfile, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) < 0)
{
save_errno = errno;
* VACUUM.
*/
const char *
-rewriteVisibilityMap(const char *fromfile, const char *tofile, bool force)
+rewriteVisibilityMap(const char *fromfile, const char *tofile)
{
int src_fd = 0;
int dst_fd = 0;
return getErrorText();
}
- if ((dst_fd = open(tofile, O_RDWR | O_CREAT | (force ? 0 : O_EXCL), S_IRUSR | S_IWUSR)) < 0)
+ if ((dst_fd = open(tofile, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) < 0)
{
close(src_fd);
return getErrorText();
/* file.c */
-const char *copyFile(const char *src, const char *dst, bool force);
+const char *copyFile(const char *src, const char *dst);
const char *linkFile(const char *src, const char *dst);
-const char *rewriteVisibilityMap(const char *fromfile, const char *tofile,
- bool force);
+const char *rewriteVisibilityMap(const char *fromfile, const char *tofile);
void check_hard_link(void);
FILE *fopen_priv(const char *path, const char *mode);
/* Rewrite visibility map if needed */
if (vm_must_add_frozenbit && (strcmp(type_suffix, "_vm") == 0))
- msg = rewriteVisibilityMap(old_file, new_file, true);
+ msg = rewriteVisibilityMap(old_file, new_file);
else
- msg = copyFile(old_file, new_file, true);
+ msg = copyFile(old_file, new_file);
if (msg)
pg_fatal("error while copying relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
/* Rewrite visibility map if needed */
if (vm_must_add_frozenbit && (strcmp(type_suffix, "_vm") == 0))
- msg = rewriteVisibilityMap(old_file, new_file, true);
+ msg = rewriteVisibilityMap(old_file, new_file);
else
msg = linkFile(old_file, new_file);