Skip to content

Commit c0c4883

Browse files
committed
Use native Cygwin symlinks so tablespaces work on Win95/98/ME which
don't support junction points. Doesn't affect native Win32.
1 parent 669ca7a commit c0c4883

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/include/port.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.63 2004/09/27 23:24:37 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.64 2004/10/11 22:50:33 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -167,18 +167,26 @@ extern int pclose_check(FILE *stream);
167167
*/
168168
extern int pgrename(const char *from, const char *to);
169169
extern int pgunlink(const char *path);
170-
extern int pgsymlink(const char *oldpath, const char *newpath);
171-
172170
/* Include this first so later includes don't see these defines */
173171
#ifdef WIN32_CLIENT_ONLY
174172
#include <io.h>
175173
#endif
176174

177175
#define rename(from, to) pgrename(from, to)
178176
#define unlink(path) pgunlink(path)
177+
178+
/*
179+
* Cygwin has its own symlinks which work on Win95/98/ME where
180+
* junction points don't, so use it instead. We have no way of
181+
* knowing what type of system Cygwin binaries will be run on.
182+
*/
183+
#ifdef WIN32
184+
extern int pgsymlink(const char *oldpath, const char *newpath);
179185
#define symlink(oldpath, newpath) pgsymlink(oldpath, newpath)
180186
#endif
181187

188+
#endif
189+
182190
extern bool rmtree(char *path, bool rmtopdir);
183191

184192
#ifdef WIN32

src/port/dirmod.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.27 2004/09/27 19:16:02 momjian Exp $
13+
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.28 2004/10/11 22:50:48 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -142,6 +142,7 @@ pgunlink(const char *path)
142142
}
143143

144144

145+
#ifdef WIN32 /* Cygwin has its own symlinks */
145146
/*
146147
* pgsymlink support:
147148
*
@@ -160,9 +161,7 @@ typedef struct
160161
WORD PrintNameOffset;
161162
WORD PrintNameLength;
162163
WCHAR PathBuffer[1];
163-
}
164-
165-
REPARSE_JUNCTION_DATA_BUFFER;
164+
} REPARSE_JUNCTION_DATA_BUFFER;
166165

167166
#define REPARSE_JUNCTION_DATA_BUFFER_HEADER_SIZE \
168167
FIELD_OFFSET(REPARSE_JUNCTION_DATA_BUFFER, SubstituteNameOffset)
@@ -246,6 +245,7 @@ pgsymlink(const char *oldpath, const char *newpath)
246245
return 0;
247246
}
248247
#endif
248+
#endif
249249

250250

251251
/* We undefined this above, so we redefine it */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy