Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4d4953fc
Commit
4d4953fc
authored
Apr 18, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Win32 tests to match existing Cygwin tests, where appropriate.
parent
cb7fb3ca
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
109 additions
and
42 deletions
+109
-42
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+2
-2
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+10
-13
src/include/c.h
src/include/c.h
+11
-5
src/include/pg_config_manual.h
src/include/pg_config_manual.h
+17
-1
src/include/port/cygwin.h
src/include/port/cygwin.h
+3
-4
src/include/port/win32.h
src/include/port/win32.h
+57
-0
src/include/utils/datetime.h
src/include/utils/datetime.h
+1
-8
src/interfaces/ecpg/include/sqlca.h
src/interfaces/ecpg/include/sqlca.h
+1
-1
src/interfaces/ecpg/pgtypeslib/dt.h
src/interfaces/ecpg/pgtypeslib/dt.h
+4
-3
src/tools/entab/entab.c
src/tools/entab/entab.c
+3
-5
No files found.
src/backend/access/transam/xlog.c
View file @
4d4953fc
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.11
2 2003/02/21 00:06:22 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.11
3 2003/04/18 01:03:41 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1507,7 +1507,7 @@ InstallXLogFileSegment(uint32 log, uint32 seg, char *tmppath,
* overwrite an existing logfile. However, there shouldn't be one, so
* rename() is an acceptable substitute except for the truly paranoid.
*/
#if
!defined(__BEOS__) && !defined(N_PLAT_NLM) && !defined(__CYGWIN__)
#if
HAVE_WORKING_LINK
if
(
link
(
tmppath
,
path
)
<
0
)
elog
(
PANIC
,
"link from %s to %s (initialization of log file %u, segment %u) failed: %m"
,
tmppath
,
path
,
log
,
seg
);
...
...
src/backend/postmaster/postmaster.c
View file @
4d4953fc
...
...
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.31
1 2003/04/17 22:26:01 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.31
2 2003/04/18 01:03:42 momjian
Exp $
*
* NOTES
*
...
...
@@ -299,9 +299,7 @@ checkDataDir(const char *checkdir)
char
path
[
MAXPGPATH
];
FILE
*
fp
;
#ifndef __CYGWIN__
struct
stat
stat_buf
;
#endif
if
(
checkdir
==
NULL
)
{
...
...
@@ -314,15 +312,6 @@ checkDataDir(const char *checkdir)
ExitPostmaster
(
2
);
}
/*
* Check if the directory has group or world access. If so, reject.
*
* XXX temporarily suppress check when on Windows, because there may not
* be proper support for Unix-y file permissions. Need to think of a
* reasonable check to apply on Windows.
*/
#ifndef __CYGWIN__
if
(
stat
(
checkdir
,
&
stat_buf
)
==
-
1
)
{
if
(
errno
==
ENOENT
)
...
...
@@ -332,10 +321,18 @@ checkDataDir(const char *checkdir)
checkdir
);
}
/*
* Check if the directory has group or world access. If so, reject.
*
* XXX temporarily suppress check when on Windows, because there may not
* be proper support for Unix-y file permissions. Need to think of a
* reasonable check to apply on Windows.
*/
#if !defined(__CYGWIN__) && !defined(WIN32)
if
(
stat_buf
.
st_mode
&
(
S_IRWXG
|
S_IRWXO
))
elog
(
FATAL
,
"data directory %s has group or world access; permissions should be u=rwx (0700)"
,
checkdir
);
#endif
/* !__CYGWIN__ */
#endif
/* Look for PG_VERSION before looking for pg_control */
ValidatePgVersion
(
checkdir
);
...
...
src/include/c.h
View file @
4d4953fc
...
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: c.h,v 1.13
7 2003/04/06 22:45:23 petere
Exp $
* $Id: c.h,v 1.13
8 2003/04/18 01:03:42 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -51,7 +51,7 @@
*/
#include "pg_config.h"
#include "pg_config_manual.h"
#include "pg_config_manual.h"
/* must be after pg_config.h */
#include "pg_config_os.h"
#include "postgres_ext.h"
...
...
@@ -65,10 +65,8 @@
#endif
#include <sys/types.h>
#ifdef __CYGWIN__
#include <errno.h>
#include <sys/fcntl.h>
/* ensure O_BINARY is available */
#endif
#ifdef HAVE_SUPPORTDEFS_H
#include <SupportDefs.h>
#endif
...
...
@@ -321,6 +319,14 @@ typedef unsigned long int uint64;
#define HAVE_INT64_TIMESTAMP
#endif
/* Global variable holding time zone information. */
#ifndef HAVE_UNDERSCORE_TIMEZONE
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname
/* should be in time.h? */
#endif
/* sig_atomic_t is required by ANSI C, but may be missing on old platforms */
#ifndef HAVE_SIG_ATOMIC_T
typedef
int
sig_atomic_t
;
...
...
@@ -680,7 +686,7 @@ typedef NameData *Name;
* ----------------------------------------------------------------
*/
#if
def __CYGWIN__
#if
defined(__CYGWIN__) || defined(WIN32)
#define PG_BINARY O_BINARY
#define PG_BINARY_R "rb"
#define PG_BINARY_W "wb"
...
...
src/include/pg_config_manual.h
View file @
4d4953fc
...
...
@@ -6,7 +6,7 @@
* for developers. If you edit any of these, be sure to do a *full*
* rebuild (and an initdb if noted).
*
* $Id: pg_config_manual.h,v 1.
1 2003/04/06 22:45:23 petere
Exp $
* $Id: pg_config_manual.h,v 1.
2 2003/04/18 01:03:42 momjian
Exp $
*------------------------------------------------------------------------
*/
...
...
@@ -134,6 +134,22 @@
# define HAVE_UNIX_SOCKETS 1
#endif
/*
* Define this if your operating system supports link()
*/
#if !defined(__QNX__) && !defined(__BEOS__) && \
!defined(__CYGWIN__) && !defined(WIN32)
# define HAVE_WORKING_LINK 1
#endif
/*
* Define this if your operating system has _timezone rather than timezone
*/
#if defined(__CYGWIN__) || defined(WIN32)
# define HAVE_INT_TIMEZONE
/* has int _timezone */
# define HAVE_UNDERSCORE_TIMEZONE 1
#endif
/*
* This is the default directory in which AF_UNIX socket files are
* placed. Caution: changing this risks breaking your existing client
...
...
src/include/port/cygwin.h
View file @
4d4953fc
/* $Header: /cvsroot/pgsql/src/include/port/cygwin.h,v 1.1 2003/03/21 17:18:34 petere Exp $ */
/* $Header: /cvsroot/pgsql/src/include/port/cygwin.h,v 1.2 2003/04/18 01:03:42 momjian Exp $ */
#include <port/win32defs.h>
#define HAS_TEST_AND_SET
typedef
unsigned
char
slock_t
;
#define tzname _tzname
/* should be in time.h? */
#define HAVE_INT_TIMEZONE
/* has int _timezone */
#include <cygwin/version.h>
/*
...
...
src/include/port/win32.h
View file @
4d4953fc
/* $Header: /cvsroot/pgsql/src/include/port/win32.h,v 1.7 2003/04/18 01:03:42 momjian Exp $ */
#include <port/win32defs.h>
#define USES_WINSOCK
#define NOFILE 100
...
...
@@ -27,3 +31,56 @@
#define DLLIMPORT
#endif
/*
* Supplement to <sys/types.h>.
*/
#define uid_t int
#define gid_t int
#define pid_t unsigned long
#define ssize_t int
#define mode_t int
#define key_t long
#define ushort unsigned short
/*
* Supplement to <sys/stat.h>.
*/
#define lstat slat
#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
#define S_IRUSR _S_IREAD
#define S_IWUSR _S_IWRITE
#define S_IXUSR _S_IEXEC
#define S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
/*
* Supplement to <errno.h>.
*/
#include <errno.h>
#undef EAGAIN
#undef EINTR
#define EINTR WSAEINTR
#define EAGAIN WSAEWOULDBLOCK
#define EMSGSIZE WSAEMSGSIZE
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#define EWOULDBLOCK WSAEWOULDBLOCK
#define ECONNRESET WSAECONNRESET
#define EINPROGRESS WSAEINPROGRESS
/*
* Supplement to <math.h>.
*/
#define isnan _isnan
#define finite _finite
extern
double
rint
(
double
x
);
/*
* Supplement to <stdio.h>.
*/
#define snprintf _snprintf
#define vsnprintf _vsnprintf
src/include/utils/datetime.h
View file @
4d4953fc
...
...
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: datetime.h,v 1.3
7 2003/04/04 04:50:44 tgl
Exp $
* $Id: datetime.h,v 1.3
8 2003/04/18 01:03:42 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -216,13 +216,6 @@ do { \
} while(0)
#endif
/* Global variable holding time zone information. */
#if defined(__CYGWIN__) || defined(N_PLAT_NLM)
#define TIMEZONE_GLOBAL _timezone
#else
#define TIMEZONE_GLOBAL timezone
#endif
/*
* Date/time validation
* Include check for leap year.
...
...
src/interfaces/ecpg/include/sqlca.h
View file @
4d4953fc
...
...
@@ -2,7 +2,7 @@
#define POSTGRES_SQLCA_H
#ifndef DLLIMPORT
#if
def __CYGWIN__
#if
defined(__CYGWIN__) || defined(WIN32)
#define DLLIMPORT __declspec (dllimport)
#else
#define DLLIMPORT
...
...
src/interfaces/ecpg/pgtypeslib/dt.h
View file @
4d4953fc
...
...
@@ -216,10 +216,11 @@ do { \
#endif
/* Global variable holding time zone information. */
#if defined(__CYGWIN__) || defined(N_PLAT_NLM)
#define TIMEZONE_GLOBAL _timezone
#else
#if !defined(__CYGWIN__) && !defined(WIN32)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname
/* should be in time.h? */
#endif
/*
...
...
src/tools/entab/entab.c
View file @
4d4953fc
...
...
@@ -12,6 +12,8 @@
#include <stdlib.h>
#include <string.h>
#include "../include/c.h"
#define NUL '\0'
#ifndef TRUE
...
...
@@ -94,11 +96,7 @@ char **argv;
in_file
=
stdin
;
else
{
#ifndef __CYGWIN__
if
((
in_file
=
fopen
(
*
argv
,
"r"
))
==
NULL
)
#else
if
((
in_file
=
fopen
(
*
argv
,
"rb"
))
==
NULL
)
#endif
if
((
in_file
=
fopen
(
*
argv
,
PG_BINARY_R
))
==
NULL
)
halt
(
"PERROR: Can not open file %s
\n
"
,
argv
[
0
]);
argv
++
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment