From c028568217ce84574b4c46b9c66d2530caaad440 Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Tue, 27 Aug 1996 06:55:28 +0000 Subject: [PATCH] first pass...move some of the "Port" dependencies to src/include/config.h --- src/backend/postmaster/postmaster.c | 81 +++++++++++++++-------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index bda76dd218..8e50f04182 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.5 1996/08/14 04:51:34 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.6 1996/08/27 06:55:28 scrappy Exp $ * * NOTES * @@ -33,43 +33,47 @@ *------------------------------------------------------------------------- */ #include "libpq/pqsignal.h" /* substitute for */ +#include "config.h" + #include #include -#ifndef WIN32 -#include -#endif /* WIN32 */ + +#if !defined(NO_UNISTD_H) +# include +#endif /* !NO_UNISTD_H */ + #include #include /* for fd_set stuff */ #include /* for umask */ #include #include /* for MAXHOSTNAMELEN on most */ -#ifdef WIN32 -#include -#include -#define MAXINT INT_MAX + +#if defined(USES_WINSOCK) +# include +# include +# define MAXINT INT_MAX #else -#include /* for MAXHOSTNAMELEN on some */ -#ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */ -#include -#define MAXHOSTNAMELEN MAXDNAME -#endif -# if defined(PORTNAME_BSD44_derived) || \ - defined(PORTNAME_bsdi) || \ - defined(PORTNAME_bsdi_2_1) -# include -# define MAXINT INT_MAX +# include /* for MAXHOSTNAMELEN on some */ +# ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */ +# include +# define MAXHOSTNAMELEN MAXDNAME +# endif +# if defined(USE_LIMITS_H) +# include +# define MAXINT INT_MAX # else -# include -# endif /* !PORTNAME_BSD44_derived */ -#include -#endif /* WIN32 */ +# include +# endif /* !USE_LIMITS_H */ +# include +#endif /* USES_WINSOCK */ + #include #include #include -#if defined(PORTNAME_aix) -#include -#endif /* PORTNAME_aix */ +#if defined(NEED_SYS_SELECT_H) +# include +#endif /* NEED_SYS_SELECT_H */ #include "storage/ipc.h" #include "libpq/libpq.h" @@ -81,15 +85,14 @@ #include "storage/proc.h" #include "utils/elog.h" -#ifdef DBX_VERSION -#define FORK() (0) +#if defined(DBX_VERSION) +# define FORK() (0) #else -#if defined(PORTNAME_irix5) -/* IRIX 5 does not have vfork() */ -#define FORK() fork() -#else -#define FORK() vfork() -#endif +# if defined(NO_VFORK) +# define FORK() fork() +# else +# define FORK() vfork() +# endif #endif /* @@ -140,7 +143,7 @@ static int SendStop = 0; static int MultiplexedBackends = 0; static int MultiplexedBackendPort; -#ifdef HBA +#if defined(HBA) static int useHostBasedAuth = 1; #else static int useHostBasedAuth = 0; @@ -153,7 +156,7 @@ static void pmdaemonize(void); static int ConnStartup(Port *port); static int ConnCreate(int serverFd, int *newFdP); static void reset_shared(short port); -#if defined(PORTNAME_linux) +#if defined(linux) static void pmdie(int); static void reaper(int); static void dumpstatus(int); @@ -184,7 +187,7 @@ PostmasterMain(int argc, char *argv[]) int status; int silentflag = 0; char hostbuf[MAXHOSTNAMELEN]; -#ifdef WIN32 +#if defined(WIN32) WSADATA WSAData; #endif /* WIN32 */ @@ -313,7 +316,7 @@ PostmasterMain(int argc, char *argv[]) } -#ifdef WIN32 +#if defined(WIN32) if ((status = WSAStartup(MAKEWORD(1,1), &WSAData)) == 0) (void) printf("%s\nInitializing WinSock: %s\n", WSAData.szDescription, WSAData.szSystemStatus); else @@ -951,7 +954,7 @@ DoExec(StartupInfo *packet, int portFd) char dbbuf[ARGV_SIZE + 1]; int ac = 0; int i; -#ifdef WIN32 +#if defined(WIN32) char win32_args[(2 * ARGV_SIZE) + 1]; PROCESS_INFORMATION piProcInfo; STARTUPINFO siStartInfo; @@ -984,7 +987,7 @@ DoExec(StartupInfo *packet, int portFd) if (packet->tty[0]) { (void) strncpy(ttybuf, packet->tty, ARGV_SIZE); av[ac++] = "-o"; -#ifdef WIN32 +#if defined(WIN32) /* BIG HACK - The front end is passing "/dev/null" here which ** causes new backends to fail. So, as a very special case, ** use a real NT filename.