mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Remove WIN32 defines. They never worked.
This commit is contained in:
@@ -6,16 +6,12 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.2 1996/11/06 10:31:52 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.3 1997/02/14 04:18:08 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#ifndef WIN32
|
||||
#include <grp.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif /* WIN32 */
|
||||
#include <pwd.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -47,7 +43,6 @@
|
||||
int
|
||||
ValidateBackend(char *path)
|
||||
{
|
||||
#ifndef WIN32
|
||||
struct stat buf;
|
||||
uid_t euid;
|
||||
struct group *gp;
|
||||
@@ -56,9 +51,6 @@ ValidateBackend(char *path)
|
||||
int is_r = 0;
|
||||
int is_x = 0;
|
||||
int in_grp = 0;
|
||||
#else
|
||||
DWORD file_attributes;
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*
|
||||
* Ensure that the file exists and is a regular file.
|
||||
@@ -73,7 +65,6 @@ ValidateBackend(char *path)
|
||||
return(-1);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (stat(path, &buf) < 0) {
|
||||
if (DebugLvl > 1)
|
||||
fprintf(stderr, "ValidateBackend: can't stat \"%s\"\n",
|
||||
@@ -139,13 +130,6 @@ ValidateBackend(char *path)
|
||||
fprintf(stderr, "ValidateBackend: \"%s\" is not other read/execute\n",
|
||||
path);
|
||||
return(is_x ? (is_r ? 0 : -2) : -1);
|
||||
#else
|
||||
file_attributes = GetFileAttributes(path);
|
||||
if(file_attributes != 0xFFFFFFFF)
|
||||
return(0);
|
||||
else
|
||||
return(-1);
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -163,11 +147,6 @@ FindBackend(char *backend, char *argv0)
|
||||
char *path, *startp, *endp;
|
||||
int pathlen;
|
||||
|
||||
#ifdef WIN32
|
||||
strcpy(backend, argv0);
|
||||
return(0);
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*
|
||||
* for the postmaster:
|
||||
* First try: use the backend that's located in the same directory
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.3 1996/11/14 10:24:41 bryanh Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.4 1997/02/14 04:18:17 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -18,10 +18,8 @@
|
||||
#include <sys/file.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#ifndef WIN32
|
||||
#include <grp.h> /* for getgrgid */
|
||||
#include <pwd.h> /* for getpwuid */
|
||||
#endif /* WIN32 */
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
@@ -58,9 +56,7 @@ extern char *DatabasePath;
|
||||
* Define USE_ENVIRONMENT to get PGDATA, etc. from environment variables.
|
||||
* This is the default on UNIX platforms.
|
||||
*/
|
||||
#ifndef WIN32
|
||||
#define USE_ENVIRONMENT
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* some of the 19 ways to leave postgres
|
||||
@@ -294,15 +290,6 @@ SetPgUserName()
|
||||
UserName = malloc(strlen(p)+1);
|
||||
strcpy(UserName, p);
|
||||
#endif /* NO_SECURITY */
|
||||
|
||||
#ifdef WIN32
|
||||
/* XXX We'll figure out how to get the user name later */
|
||||
if (UserName)
|
||||
free(UserName);
|
||||
UserName = malloc(strlen(p)+1);
|
||||
strcpy(UserName, "postgres");
|
||||
#endif /* WIN32 */
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.7 1997/01/08 08:33:07 bryanh Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.8 1997/02/14 04:18:20 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* InitPostgres() is the function called from PostgresMain
|
||||
@@ -135,9 +135,6 @@ InitMyDatabaseId()
|
||||
dbfname = (char *) palloc(strlen(DataDir) + strlen("pg_database") + 2);
|
||||
sprintf(dbfname, "%s%cpg_database", DataDir, SEP_CHAR);
|
||||
fileflags = O_RDONLY;
|
||||
#ifdef WIN32
|
||||
fileflags |= _O_BINARY;
|
||||
#endif /* WIN32 */
|
||||
|
||||
if ((dbfd = open(dbfname, O_RDONLY, 0666)) < 0)
|
||||
elog(FATAL, "Cannot open %s", dbfname);
|
||||
@@ -259,11 +256,7 @@ static void
|
||||
DoChdirAndInitDatabaseNameAndPath(char *name) {
|
||||
char *reason;
|
||||
/* Failure reason returned by some function. NULL if no failure */
|
||||
#ifndef WIN32
|
||||
struct stat statbuf;
|
||||
#else
|
||||
struct _stat statbuf;
|
||||
#endif
|
||||
char errormsg[1000];
|
||||
|
||||
if (stat(DataDir, &statbuf) < 0)
|
||||
|
||||
Reference in New Issue
Block a user