1
0
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:
Bruce Momjian
1997-02-14 04:19:07 +00:00
parent aaaba5a048
commit 31c8e94b34
26 changed files with 39 additions and 386 deletions

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.4 1996/11/10 03:03:05 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.5 1997/02/14 04:17:35 momjian Exp $
*
* NOTES
* This code is actually (almost) unused.
@@ -855,16 +855,13 @@ text *
timeofday(void)
{
#ifndef WIN32
struct timeval tp;
struct timezone tpz;
#endif /* WIN32 */
char templ[500];
char buf[500];
text *tm;
int len = 0;
#ifndef WIN32
gettimeofday(&tp, &tpz);
(void) strftime(templ, sizeof(templ), "%a %b %d %H:%M:%S.%%d %Y %Z",
localtime((time_t *) &tp.tv_sec));
@@ -875,9 +872,4 @@ timeofday(void)
VARSIZE(tm) = len;
strncpy(VARDATA(tm), buf, strlen(buf));
return tm;
#else
len = len / len;
return tm;
#endif /* WIN32 */
}

View File

@@ -7,16 +7,14 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.5 1996/11/08 05:59:43 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.6 1997/02/14 04:17:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <string.h>
#include <stdio.h>
#ifndef WIN32
#include <pwd.h>
#endif /* WIN32 */
#include <sys/param.h>
@@ -35,7 +33,6 @@ filename_in(char *file)
* should let the shell do expansions (shexpand)
*/
#ifndef WIN32
str = (char *) palloc(MAXPATHLEN * sizeof(*str));
str[0] = '\0';
if (file[0] == '~') {
@@ -103,9 +100,6 @@ filename_in(char *file)
}
strcat(str, file+ind);
return(str);
#else
return(NULL);
#endif /* WIN32 */
}
char *

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.10 1997/01/24 18:17:06 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.11 1997/02/14 04:17:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -220,17 +220,10 @@ char *float8out(float64 num)
if (!num)
return strcpy(ascii, "(null)");
#ifndef WIN32
if (isnan(*num))
return strcpy(ascii, "NaN");
if (isinf(*num))
return strcpy(ascii, "Infinity");
#else
if (_isnan(*num))
return strcpy(ascii, "NaN");
if (!_finite(*num))
return strcpy(ascii, "Infinity");
#endif
sprintf(ascii, "%.*g", DBL_DIG, *num);
return(ascii);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.11 1996/11/14 10:24:22 bryanh Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.12 1997/02/14 04:17:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -34,9 +34,6 @@ static int Err_file = -1;
static int ElogDebugIndentLevel = 0;
extern char OutputFileName[];
#ifdef WIN32
extern jmp_buf Warn_restart;
#endif
/*
* elog --
@@ -160,12 +157,8 @@ elog(int lev, const char *fmt, ... )
extern int InWarn;
ProcReleaseSpins(NULL); /* get rid of spinlocks we hold */
if (!InWarn) {
#ifndef WIN32
kill(getpid(), 1); /* abort to traffic cop */
pause();
#else
longjmp(Warn_restart, 1);
#endif /* WIN32 */
}
/*
* The pause(3) is just to avoid race conditions where the
@@ -227,7 +220,6 @@ DebugFileOpen(void)
Err_file = Debugfile = fileno(stderr);
return(Debugfile);
}
#ifndef WIN32
/* If no filename was specified, send debugging output to stderr.
* If stderr has been hosed, try to open a file.
*/
@@ -237,7 +229,6 @@ DebugFileOpen(void)
DataDir, (int)getpid());
fd = open(OutputFileName, O_CREAT|O_APPEND|O_WRONLY, 0666);
}
#endif /* WIN32 */
if (fd < 0)
elog(FATAL, "DebugFileOpen: could not open debugging file");

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.5 1997/02/13 09:54:04 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.6 1997/02/14 04:18:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,11 +118,7 @@ handle_load(char *filename, char *funcname)
DynamicFileList *file_scanner = (DynamicFileList *) NULL;
func_ptr retval = (func_ptr) NULL;
char *load_error;
#ifdef WIN32
struct _stat stat_buf;
#else
struct stat stat_buf;
#endif /* WIN32 */
/*
* Do this because loading files may screw up the dynamic function
@@ -180,10 +176,8 @@ handle_load(char *filename, char *funcname)
memset((char *) file_scanner, 0, sizeof(DynamicFileList));
(void) strcpy(file_scanner->filename, filename);
#ifndef WIN32
file_scanner->device = stat_buf.st_dev;
file_scanner->inode = stat_buf.st_ino;
#endif /* WIN32 */
file_scanner->next = (DynamicFileList *) NULL;
file_scanner->handle = pg_dlopen(filename);
@@ -232,11 +226,7 @@ void
load_file(char *filename)
{
DynamicFileList *file_scanner, *p;
#ifdef WIN32
struct _stat stat_buf;
#else
struct stat stat_buf;
#endif /* WIN32 */
struct stat stat_buf;
int done = 0;

View File

@@ -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

View File

@@ -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 */
}
/* ----------------------------------------------------------------

View File

@@ -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)