Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 11e482c

Browse files
committed
Move copydir() prototype into its own header file.
Having this in src/include/port.h makes no sense, now that copydir.c lives in src/backend/strorage rather than src/port. Along the way, remove an obsolete comment from contrib/pg_upgrade that makes reference to the old location.
1 parent d730424 commit 11e482c

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

contrib/pg_upgrade/pg_upgrade.c

-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ copy_clog_xlog_xid(void)
259259
check_ok();
260260

261261
prep_status("Copying old commit clogs to new server");
262-
/* libpgport's copydir() doesn't work in FRONTEND code */
263262
#ifndef WIN32
264263
exec_prog(true, SYSTEMQUOTE "%s \"%s\" \"%s\"" SYSTEMQUOTE,
265264
"cp -Rf",

src/backend/commands/dbcommands.c

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "pgstat.h"
4545
#include "postmaster/bgwriter.h"
4646
#include "storage/bufmgr.h"
47+
#include "storage/copydir.h"
4748
#include "storage/fd.h"
4849
#include "storage/lmgr.h"
4950
#include "storage/ipc.h"

src/backend/storage/file/copydir.c

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <unistd.h>
2323
#include <sys/stat.h>
2424

25+
#include "storage/copydir.h"
2526
#include "storage/fd.h"
2627
#include "miscadmin.h"
2728

src/include/port.h

-2
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,6 @@ extern int pgsymlink(const char *oldpath, const char *newpath);
288288
#define symlink(oldpath, newpath) pgsymlink(oldpath, newpath)
289289
#endif
290290

291-
extern void copydir(char *fromdir, char *todir, bool recurse);
292-
293291
extern bool rmtree(const char *path, bool rmtopdir);
294292

295293
/*

src/include/storage/copydir.h

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* port.h
4+
* Header for src/port/ compatibility functions.
5+
*
6+
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
7+
* Portions Copyright (c) 1994, Regents of the University of California
8+
*
9+
* src/include/port.h
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndef COPYDIR_H
14+
#define COPYDIR_H
15+
16+
extern void copydir(char *fromdir, char *todir, bool recurse);
17+
18+
#endif /* COPYDIR_H */

0 commit comments

Comments
 (0)