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

Commit4d4953f

Browse files
committed
Make Win32 tests to match existing Cygwin tests, where appropriate.
1 parentcb7fb3c commit4d4953f

File tree

10 files changed

+109
-42
lines changed

10 files changed

+109
-42
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.112 2003/02/21 00:06:22 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.113 2003/04/18 01:03:41 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1507,7 +1507,7 @@ InstallXLogFileSegment(uint32 log, uint32 seg, char *tmppath,
15071507
* overwrite an existing logfile. However, there shouldn't be one, so
15081508
* rename() is an acceptable substitute except for the truly paranoid.
15091509
*/
1510-
#if!defined(__BEOS__)&& !defined(N_PLAT_NLM)&& !defined(__CYGWIN__)
1510+
#ifHAVE_WORKING_LINK
15111511
if (link(tmppath,path)<0)
15121512
elog(PANIC,"link from %s to %s (initialization of log file %u, segment %u) failed: %m",
15131513
tmppath,path,log,seg);

‎src/backend/postmaster/postmaster.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.311 2003/04/17 22:26:01 tgl Exp $
40+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.312 2003/04/18 01:03:42 momjian Exp $
4141
*
4242
* NOTES
4343
*
@@ -299,9 +299,7 @@ checkDataDir(const char *checkdir)
299299
charpath[MAXPGPATH];
300300
FILE*fp;
301301

302-
#ifndef__CYGWIN__
303302
structstatstat_buf;
304-
#endif
305303

306304
if (checkdir==NULL)
307305
{
@@ -314,15 +312,6 @@ checkDataDir(const char *checkdir)
314312
ExitPostmaster(2);
315313
}
316314

317-
/*
318-
* Check if the directory has group or world access. If so, reject.
319-
*
320-
* XXX temporarily suppress check when on Windows, because there may not
321-
* be proper support for Unix-y file permissions. Need to think of a
322-
* reasonable check to apply on Windows.
323-
*/
324-
#ifndef__CYGWIN__
325-
326315
if (stat(checkdir,&stat_buf)==-1)
327316
{
328317
if (errno==ENOENT)
@@ -332,10 +321,18 @@ checkDataDir(const char *checkdir)
332321
checkdir);
333322
}
334323

324+
/*
325+
* Check if the directory has group or world access. If so, reject.
326+
*
327+
* XXX temporarily suppress check when on Windows, because there may not
328+
* be proper support for Unix-y file permissions. Need to think of a
329+
* reasonable check to apply on Windows.
330+
*/
331+
#if !defined(__CYGWIN__)&& !defined(WIN32)
335332
if (stat_buf.st_mode& (S_IRWXG |S_IRWXO))
336333
elog(FATAL,"data directory %s has group or world access; permissions should be u=rwx (0700)",
337334
checkdir);
338-
#endif/* !__CYGWIN__ */
335+
#endif
339336

340337
/* Look for PG_VERSION before looking for pg_control */
341338
ValidatePgVersion(checkdir);

‎src/include/c.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: c.h,v 1.137 2003/04/06 22:45:23 petere Exp $
15+
* $Id: c.h,v 1.138 2003/04/18 01:03:42 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -51,7 +51,7 @@
5151
*/
5252

5353
#include"pg_config.h"
54-
#include"pg_config_manual.h"
54+
#include"pg_config_manual.h"/* must be after pg_config.h */
5555
#include"pg_config_os.h"
5656
#include"postgres_ext.h"
5757

@@ -65,10 +65,8 @@
6565
#endif
6666
#include<sys/types.h>
6767

68-
#ifdef__CYGWIN__
6968
#include<errno.h>
7069
#include<sys/fcntl.h>/* ensure O_BINARY is available */
71-
#endif
7270
#ifdefHAVE_SUPPORTDEFS_H
7371
#include<SupportDefs.h>
7472
#endif
@@ -321,6 +319,14 @@ typedef unsigned long int uint64;
321319
#defineHAVE_INT64_TIMESTAMP
322320
#endif
323321

322+
/* Global variable holding time zone information. */
323+
#ifndefHAVE_UNDERSCORE_TIMEZONE
324+
#defineTIMEZONE_GLOBAL timezone
325+
#else
326+
#defineTIMEZONE_GLOBAL _timezone
327+
#definetzname _tzname/* should be in time.h? */
328+
#endif
329+
324330
/* sig_atomic_t is required by ANSI C, but may be missing on old platforms */
325331
#ifndefHAVE_SIG_ATOMIC_T
326332
typedefintsig_atomic_t;
@@ -680,7 +686,7 @@ typedef NameData *Name;
680686
* ----------------------------------------------------------------
681687
*/
682688

683-
#ifdef__CYGWIN__
689+
#if defined(__CYGWIN__)|| defined(WIN32)
684690
#definePG_BINARYO_BINARY
685691
#definePG_BINARY_R "rb"
686692
#definePG_BINARY_W "wb"

‎src/include/pg_config_manual.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* for developers. If you edit any of these, be sure to do a *full*
77
* rebuild (and an initdb if noted).
88
*
9-
* $Id: pg_config_manual.h,v 1.1 2003/04/06 22:45:23 petere Exp $
9+
* $Id: pg_config_manual.h,v 1.2 2003/04/18 01:03:42 momjian Exp $
1010
*------------------------------------------------------------------------
1111
*/
1212

@@ -134,6 +134,22 @@
134134
# defineHAVE_UNIX_SOCKETS 1
135135
#endif
136136

137+
/*
138+
* Define this if your operating system supports link()
139+
*/
140+
#if !defined(__QNX__)&& !defined(__BEOS__)&& \
141+
!defined(__CYGWIN__)&& !defined(WIN32)
142+
# defineHAVE_WORKING_LINK 1
143+
#endif
144+
145+
/*
146+
* Define this if your operating system has _timezone rather than timezone
147+
*/
148+
#if defined(__CYGWIN__)|| defined(WIN32)
149+
# defineHAVE_INT_TIMEZONE/* has int _timezone */
150+
# defineHAVE_UNDERSCORE_TIMEZONE 1
151+
#endif
152+
137153
/*
138154
* This is the default directory in which AF_UNIX socket files are
139155
* placed. Caution: changing this risks breaking your existing client

‎src/include/port/cygwin.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
/* $Header: /cvsroot/pgsql/src/include/port/cygwin.h,v 1.1 2003/03/21 17:18:34 petere Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/include/port/cygwin.h,v 1.2 2003/04/18 01:03:42 momjian Exp $ */
2+
3+
#include<port/win32defs.h>
24

35
#defineHAS_TEST_AND_SET
46
typedefunsignedcharslock_t;
57

6-
#definetzname _tzname/* should be in time.h? */
7-
#defineHAVE_INT_TIMEZONE/* has int _timezone */
8-
98
#include<cygwin/version.h>
109

1110
/*

‎src/include/port/win32.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/* $Header: /cvsroot/pgsql/src/include/port/win32.h,v 1.7 2003/04/18 01:03:42 momjian Exp $ */
2+
3+
#include<port/win32defs.h>
4+
15
#defineUSES_WINSOCK
26
#defineNOFILE 100
37

@@ -27,3 +31,56 @@
2731
#defineDLLIMPORT
2832

2933
#endif
34+
35+
/*
36+
* Supplement to <sys/types.h>.
37+
*/
38+
#defineuid_t int
39+
#definegid_t int
40+
#definepid_t unsigned long
41+
#definessize_t int
42+
#definemode_t int
43+
#definekey_t long
44+
#defineushort unsigned short
45+
46+
/*
47+
* Supplement to <sys/stat.h>.
48+
*/
49+
#definelstat slat
50+
51+
#defineS_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
52+
#defineS_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
53+
54+
#defineS_IRUSR _S_IREAD
55+
#defineS_IWUSR _S_IWRITE
56+
#defineS_IXUSR _S_IEXEC
57+
#defineS_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
58+
59+
/*
60+
* Supplement to <errno.h>.
61+
*/
62+
#include<errno.h>
63+
#undef EAGAIN
64+
#undef EINTR
65+
#defineEINTR WSAEINTR
66+
#defineEAGAIN WSAEWOULDBLOCK
67+
#defineEMSGSIZE WSAEMSGSIZE
68+
#defineEAFNOSUPPORT WSAEAFNOSUPPORT
69+
#defineEWOULDBLOCK WSAEWOULDBLOCK
70+
#defineECONNRESET WSAECONNRESET
71+
#defineEINPROGRESS WSAEINPROGRESS
72+
73+
/*
74+
* Supplement to <math.h>.
75+
*/
76+
#defineisnan _isnan
77+
#definefinite _finite
78+
externdoublerint(doublex);
79+
80+
/*
81+
* Supplement to <stdio.h>.
82+
*/
83+
#definesnprintf _snprintf
84+
#definevsnprintf _vsnprintf
85+
86+

‎src/include/utils/datetime.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $Id: datetime.h,v 1.37 2003/04/04 04:50:44 tgl Exp $
12+
* $Id: datetime.h,v 1.38 2003/04/18 01:03:42 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -216,13 +216,6 @@ do { \
216216
} while(0)
217217
#endif
218218

219-
/* Global variable holding time zone information. */
220-
#if defined(__CYGWIN__)|| defined(N_PLAT_NLM)
221-
#defineTIMEZONE_GLOBAL _timezone
222-
#else
223-
#defineTIMEZONE_GLOBAL timezone
224-
#endif
225-
226219
/*
227220
* Date/time validation
228221
* Include check for leap year.

‎src/interfaces/ecpg/include/sqlca.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#definePOSTGRES_SQLCA_H
33

44
#ifndefDLLIMPORT
5-
#ifdef__CYGWIN__
5+
#if defined(__CYGWIN__)|| defined(WIN32)
66
#defineDLLIMPORT __declspec (dllimport)
77
#else
88
#defineDLLIMPORT

‎src/interfaces/ecpg/pgtypeslib/dt.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,11 @@ do { \
216216
#endif
217217

218218
/* Global variable holding time zone information. */
219-
#if defined(__CYGWIN__)|| defined(N_PLAT_NLM)
220-
#defineTIMEZONE_GLOBAL _timezone
221-
#else
219+
#if !defined(__CYGWIN__)&& !defined(WIN32)
222220
#defineTIMEZONE_GLOBAL timezone
221+
#else
222+
#defineTIMEZONE_GLOBAL _timezone
223+
#definetzname _tzname/* should be in time.h? */
223224
#endif
224225

225226
/*

‎src/tools/entab/entab.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include<stdlib.h>
1313
#include<string.h>
1414

15+
#include"../include/c.h"
16+
1517
#defineNUL'\0'
1618

1719
#ifndefTRUE
@@ -94,11 +96,7 @@ char **argv;
9496
in_file=stdin;
9597
else
9698
{
97-
#ifndef__CYGWIN__
98-
if ((in_file=fopen(*argv,"r"))==NULL)
99-
#else
100-
if ((in_file=fopen(*argv,"rb"))==NULL)
101-
#endif
99+
if ((in_file=fopen(*argv,PG_BINARY_R))==NULL)
102100
halt("PERROR: Can not open file %s\n",argv[0]);
103101
argv++;
104102
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp