Skip to content

Commit c028568

Browse files
committed
first pass...move some of the "Port" dependencies to src/include/config.h
1 parent 672aec6 commit c028568

File tree

1 file changed

+42
-39
lines changed

1 file changed

+42
-39
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.5 1996/08/14 04:51:34 scrappy Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.6 1996/08/27 06:55:28 scrappy Exp $
1414
*
1515
* NOTES
1616
*
@@ -33,43 +33,47 @@
3333
*-------------------------------------------------------------------------
3434
*/
3535
#include "libpq/pqsignal.h" /* substitute for <signal.h> */
36+
#include "config.h"
37+
3638
#include <string.h>
3739
#include <stdlib.h>
38-
#ifndef WIN32
39-
#include <unistd.h>
40-
#endif /* WIN32 */
40+
41+
#if !defined(NO_UNISTD_H)
42+
# include <unistd.h>
43+
#endif /* !NO_UNISTD_H */
44+
4145
#include <ctype.h>
4246
#include <sys/types.h> /* for fd_set stuff */
4347
#include <sys/stat.h> /* for umask */
4448
#include <sys/time.h>
4549
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
46-
#ifdef WIN32
47-
#include <winsock.h>
48-
#include <limits.h>
49-
#define MAXINT INT_MAX
50+
51+
#if defined(USES_WINSOCK)
52+
# include <winsock.h>
53+
# include <limits.h>
54+
# define MAXINT INT_MAX
5055
#else
51-
#include <netdb.h> /* for MAXHOSTNAMELEN on some */
52-
#ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */
53-
#include <arpa/nameser.h>
54-
#define MAXHOSTNAMELEN MAXDNAME
55-
#endif
56-
# if defined(PORTNAME_BSD44_derived) || \
57-
defined(PORTNAME_bsdi) || \
58-
defined(PORTNAME_bsdi_2_1)
59-
# include <machine/limits.h>
60-
# define MAXINT INT_MAX
56+
# include <netdb.h> /* for MAXHOSTNAMELEN on some */
57+
# ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */
58+
# include <arpa/nameser.h>
59+
# define MAXHOSTNAMELEN MAXDNAME
60+
# endif
61+
# if defined(USE_LIMITS_H)
62+
# include <machine/limits.h>
63+
# define MAXINT INT_MAX
6164
# else
62-
# include <values.h>
63-
# endif /* !PORTNAME_BSD44_derived */
64-
#include <sys/wait.h>
65-
#endif /* WIN32 */
65+
# include <values.h>
66+
# endif /* !USE_LIMITS_H */
67+
# include <sys/wait.h>
68+
#endif /* USES_WINSOCK */
69+
6670
#include <errno.h>
6771
#include <fcntl.h>
6872
#include <stdio.h>
6973

70-
#if defined(PORTNAME_aix)
71-
#include <sys/select.h>
72-
#endif /* PORTNAME_aix */
74+
#if defined(NEED_SYS_SELECT_H)
75+
# include <sys/select.h>
76+
#endif /* NEED_SYS_SELECT_H */
7377

7478
#include "storage/ipc.h"
7579
#include "libpq/libpq.h"
@@ -81,15 +85,14 @@
8185
#include "storage/proc.h"
8286
#include "utils/elog.h"
8387

84-
#ifdef DBX_VERSION
85-
#define FORK() (0)
86-
#else
87-
#if defined(PORTNAME_irix5)
88-
/* IRIX 5 does not have vfork() */
89-
#define FORK() fork()
88+
#if defined(DBX_VERSION)
89+
# define FORK() (0)
9090
#else
91-
#define FORK() vfork()
92-
#endif
91+
# if defined(NO_VFORK)
92+
# define FORK() fork()
93+
# else
94+
# define FORK() vfork()
95+
# endif
9396
#endif
9497

9598
/*
@@ -140,7 +143,7 @@ static int SendStop = 0;
140143
static int MultiplexedBackends = 0;
141144
static int MultiplexedBackendPort;
142145

143-
#ifdef HBA
146+
#if defined(HBA)
144147
static int useHostBasedAuth = 1;
145148
#else
146149
static int useHostBasedAuth = 0;
@@ -153,7 +156,7 @@ static void pmdaemonize(void);
153156
static int ConnStartup(Port *port);
154157
static int ConnCreate(int serverFd, int *newFdP);
155158
static void reset_shared(short port);
156-
#if defined(PORTNAME_linux)
159+
#if defined(linux)
157160
static void pmdie(int);
158161
static void reaper(int);
159162
static void dumpstatus(int);
@@ -184,7 +187,7 @@ PostmasterMain(int argc, char *argv[])
184187
int status;
185188
int silentflag = 0;
186189
char hostbuf[MAXHOSTNAMELEN];
187-
#ifdef WIN32
190+
#if defined(WIN32)
188191
WSADATA WSAData;
189192
#endif /* WIN32 */
190193

@@ -313,7 +316,7 @@ PostmasterMain(int argc, char *argv[])
313316
}
314317

315318

316-
#ifdef WIN32
319+
#if defined(WIN32)
317320
if ((status = WSAStartup(MAKEWORD(1,1), &WSAData)) == 0)
318321
(void) printf("%s\nInitializing WinSock: %s\n", WSAData.szDescription, WSAData.szSystemStatus);
319322
else
@@ -951,7 +954,7 @@ DoExec(StartupInfo *packet, int portFd)
951954
char dbbuf[ARGV_SIZE + 1];
952955
int ac = 0;
953956
int i;
954-
#ifdef WIN32
957+
#if defined(WIN32)
955958
char win32_args[(2 * ARGV_SIZE) + 1];
956959
PROCESS_INFORMATION piProcInfo;
957960
STARTUPINFO siStartInfo;
@@ -984,7 +987,7 @@ DoExec(StartupInfo *packet, int portFd)
984987
if (packet->tty[0]) {
985988
(void) strncpy(ttybuf, packet->tty, ARGV_SIZE);
986989
av[ac++] = "-o";
987-
#ifdef WIN32
990+
#if defined(WIN32)
988991
/* BIG HACK - The front end is passing "/dev/null" here which
989992
** causes new backends to fail. So, as a very special case,
990993
** use a real NT filename.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy