Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6bc12a4

Browse files
committed
Get dirmod.c on the same page as port.h about whether we use pgsymlink
on Cygwin (answer: we don't). Also try to unwind the #ifdef spaghettia little bit. Untested but hopefully I didn't break anything.
1 parentad44c95 commit6bc12a4

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

‎src/include/port.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2007, 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.111 2007/04/13 10:30:30 mha Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.112 2007/07/12 23:28:49 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -241,8 +241,7 @@ extern intpclose_check(FILE *stream);
241241

242242
#if defined(WIN32)|| defined(__CYGWIN__)
243243
/*
244-
*Win32 doesn't have reliable rename/unlink during concurrent access,
245-
*and we need special code to do symlinks.
244+
*Win32 doesn't have reliable rename/unlink during concurrent access.
246245
*/
247246
externintpgrename(constchar*from,constchar*to);
248247
externintpgunlink(constchar*path);
@@ -255,9 +254,14 @@ extern intpgunlink(const char *path);
255254
#definerename(from,to)pgrename(from, to)
256255
#defineunlink(path)pgunlink(path)
257256

257+
#endif/* defined(WIN32) || defined(__CYGWIN__) */
258+
258259
/*
260+
*Win32 also doesn't have symlinks, but we can emulate them with
261+
*junction points on newer Win32 versions.
262+
*
259263
*Cygwin has its own symlinks which work on Win95/98/ME where
260-
*junction points don't, so useit instead. We have no way of
264+
*junction points don't, so usethose instead. We have no way of
261265
*knowing what type of system Cygwin binaries will be run on.
262266
*Note: Some CYGWIN includes might #define WIN32.
263267
*/
@@ -266,7 +270,6 @@ extern intpgsymlink(const char *oldpath, const char *newpath);
266270

267271
#definesymlink(oldpath,newpath)pgsymlink(oldpath, newpath)
268272
#endif
269-
#endif/* defined(WIN32) || defined(__CYGWIN__) */
270273

271274
externvoidcopydir(char*fromdir,char*todir,boolrecurse);
272275

‎src/port/dirmod.c

Lines changed: 10 additions & 9 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.47 2007/01/19 16:42:24 alvherre Exp $
13+
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.48 2007/07/12 23:28:49 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -103,6 +103,7 @@ fe_repalloc(void *pointer, Size size)
103103
}
104104
returnres;
105105
}
106+
106107
#endif/* FRONTEND */
107108

108109

@@ -169,8 +170,14 @@ pgunlink(const char *path)
169170
return0;
170171
}
171172

173+
/* We undefined these above; now redefine for possible use below */
174+
#definerename(from,to)pgrename(from, to)
175+
#defineunlink(path)pgunlink(path)
176+
177+
#endif/* defined(WIN32) || defined(__CYGWIN__) */
178+
172179

173-
#ifdefWIN32/* Cygwin has its own symlinks */
180+
#if defined(WIN32)&& !defined(__CYGWIN__)/* Cygwin has its own symlinks */
174181

175182
/*
176183
*pgsymlink support:
@@ -276,14 +283,8 @@ pgsymlink(const char *oldpath, const char *newpath)
276283

277284
return0;
278285
}
279-
#endif/* WIN32 */
280-
#endif/* defined(WIN32) || defined(__CYGWIN__) */
281-
282286

283-
/* We undefined this above, so we redefine it */
284-
#if defined(WIN32)|| defined(__CYGWIN__)
285-
#defineunlink(path)pgunlink(path)
286-
#endif
287+
#endif/* defined(WIN32) && !defined(__CYGWIN__) */
287288

288289

289290
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp