diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c index d706fc0b03..25d732b247 100644 --- a/contrib/pg_upgrade/pg_upgrade.c +++ b/contrib/pg_upgrade/pg_upgrade.c @@ -259,7 +259,6 @@ copy_clog_xlog_xid(void) check_ok(); prep_status("Copying old commit clogs to new server"); - /* libpgport's copydir() doesn't work in FRONTEND code */ #ifndef WIN32 exec_prog(true, SYSTEMQUOTE "%s \"%s\" \"%s\"" SYSTEMQUOTE, "cp -Rf", diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 6193aa2884..8cbd7548f9 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -44,6 +44,7 @@ #include "pgstat.h" #include "postmaster/bgwriter.h" #include "storage/bufmgr.h" +#include "storage/copydir.h" #include "storage/fd.h" #include "storage/lmgr.h" #include "storage/ipc.h" diff --git a/src/backend/storage/file/copydir.c b/src/backend/storage/file/copydir.c index a9715f3c7d..4a10563ef8 100644 --- a/src/backend/storage/file/copydir.c +++ b/src/backend/storage/file/copydir.c @@ -22,6 +22,7 @@ #include #include +#include "storage/copydir.h" #include "storage/fd.h" #include "miscadmin.h" diff --git a/src/include/port.h b/src/include/port.h index f4aa69c8f6..204876888a 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -288,8 +288,6 @@ extern int pgsymlink(const char *oldpath, const char *newpath); #define symlink(oldpath, newpath) pgsymlink(oldpath, newpath) #endif -extern void copydir(char *fromdir, char *todir, bool recurse); - extern bool rmtree(const char *path, bool rmtopdir); /* diff --git a/src/include/storage/copydir.h b/src/include/storage/copydir.h new file mode 100644 index 0000000000..194d98ee07 --- /dev/null +++ b/src/include/storage/copydir.h @@ -0,0 +1,18 @@ +/*------------------------------------------------------------------------- + * + * port.h + * Header for src/port/ compatibility functions. + * + * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * src/include/port.h + * + *------------------------------------------------------------------------- + */ +#ifndef COPYDIR_H +#define COPYDIR_H + +extern void copydir(char *fromdir, char *todir, bool recurse); + +#endif /* COPYDIR_H */