1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-15 03:41:20 +03:00

Make Win32 tests to match existing Cygwin tests, where appropriate.

This commit is contained in:
Bruce Momjian
2003-04-18 01:03:42 +00:00
parent cb7fb3ca95
commit 4d4953fc41
10 changed files with 109 additions and 42 deletions

View File

@@ -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.112 2003/02/21 00:06:22 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.113 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);

View File

@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.311 2003/04/17 22:26:01 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.312 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);