10
10
*
11
11
*
12
12
* 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 $
14
14
*
15
15
* NOTES
16
16
*
33
33
*-------------------------------------------------------------------------
34
34
*/
35
35
#include "libpq/pqsignal.h" /* substitute for <signal.h> */
36
+ #include "config.h"
37
+
36
38
#include <string.h>
37
39
#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
+
41
45
#include <ctype.h>
42
46
#include <sys/types.h> /* for fd_set stuff */
43
47
#include <sys/stat.h> /* for umask */
44
48
#include <sys/time.h>
45
49
#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
50
55
#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
61
64
# 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
+
66
70
#include <errno.h>
67
71
#include <fcntl.h>
68
72
#include <stdio.h>
69
73
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 */
73
77
74
78
#include "storage/ipc.h"
75
79
#include "libpq/libpq.h"
81
85
#include "storage/proc.h"
82
86
#include "utils/elog.h"
83
87
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)
90
90
#else
91
- #define FORK () vfork()
92
- #endif
91
+ # if defined(NO_VFORK )
92
+ # define FORK () fork()
93
+ # else
94
+ # define FORK () vfork()
95
+ # endif
93
96
#endif
94
97
95
98
/*
@@ -140,7 +143,7 @@ static int SendStop = 0;
140
143
static int MultiplexedBackends = 0 ;
141
144
static int MultiplexedBackendPort ;
142
145
143
- #ifdef HBA
146
+ #if defined( HBA )
144
147
static int useHostBasedAuth = 1 ;
145
148
#else
146
149
static int useHostBasedAuth = 0 ;
@@ -153,7 +156,7 @@ static void pmdaemonize(void);
153
156
static int ConnStartup (Port * port );
154
157
static int ConnCreate (int serverFd , int * newFdP );
155
158
static void reset_shared (short port );
156
- #if defined(PORTNAME_linux )
159
+ #if defined(linux )
157
160
static void pmdie (int );
158
161
static void reaper (int );
159
162
static void dumpstatus (int );
@@ -184,7 +187,7 @@ PostmasterMain(int argc, char *argv[])
184
187
int status ;
185
188
int silentflag = 0 ;
186
189
char hostbuf [MAXHOSTNAMELEN ];
187
- #ifdef WIN32
190
+ #if defined( WIN32 )
188
191
WSADATA WSAData ;
189
192
#endif /* WIN32 */
190
193
@@ -313,7 +316,7 @@ PostmasterMain(int argc, char *argv[])
313
316
}
314
317
315
318
316
- #ifdef WIN32
319
+ #if defined( WIN32 )
317
320
if ((status = WSAStartup (MAKEWORD (1 ,1 ), & WSAData )) == 0 )
318
321
(void ) printf ("%s\nInitializing WinSock: %s\n" , WSAData .szDescription , WSAData .szSystemStatus );
319
322
else
@@ -951,7 +954,7 @@ DoExec(StartupInfo *packet, int portFd)
951
954
char dbbuf [ARGV_SIZE + 1 ];
952
955
int ac = 0 ;
953
956
int i ;
954
- #ifdef WIN32
957
+ #if defined( WIN32 )
955
958
char win32_args [(2 * ARGV_SIZE ) + 1 ];
956
959
PROCESS_INFORMATION piProcInfo ;
957
960
STARTUPINFO siStartInfo ;
@@ -984,7 +987,7 @@ DoExec(StartupInfo *packet, int portFd)
984
987
if (packet -> tty [0 ]) {
985
988
(void ) strncpy (ttybuf , packet -> tty , ARGV_SIZE );
986
989
av [ac ++ ] = "-o" ;
987
- #ifdef WIN32
990
+ #if defined( WIN32 )
988
991
/* BIG HACK - The front end is passing "/dev/null" here which
989
992
** causes new backends to fail. So, as a very special case,
990
993
** use a real NT filename.
0 commit comments