11
11
*
12
12
*
13
13
* IDENTIFICATION
14
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.142 2000/05/24 00:14:25 momjian Exp $
14
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.143 2000/05/26 01:38:08 tgl Exp $
15
15
*
16
16
* NOTES
17
17
*
@@ -1280,7 +1280,6 @@ ConnCreate(int serverFd)
1280
1280
{
1281
1281
Port * port ;
1282
1282
1283
-
1284
1283
if (!(port = (Port * )calloc (1 ,sizeof (Port ))))
1285
1284
{
1286
1285
fprintf (stderr ,"%s: ConnCreate: malloc failed\n" ,
@@ -1292,7 +1291,7 @@ ConnCreate(int serverFd)
1292
1291
if (StreamConnection (serverFd ,port )!= STATUS_OK )
1293
1292
{
1294
1293
StreamClose (port -> sock );
1295
- free (port );
1294
+ ConnFree (port );
1296
1295
port = NULL ;
1297
1296
}
1298
1297
else
@@ -1306,7 +1305,7 @@ ConnCreate(int serverFd)
1306
1305
}
1307
1306
1308
1307
/*
1309
- * ConnFree --cree a local connection data structure
1308
+ * ConnFree --free a local connection data structure
1310
1309
*/
1311
1310
static void
1312
1311
ConnFree (Port * conn )
@@ -1891,8 +1890,10 @@ DoBackend(Port *port)
1891
1890
/* Close the postmaster sockets */
1892
1891
if (NetServer )
1893
1892
StreamClose (ServerSock_INET );
1893
+ ServerSock_INET = INVALID_SOCK ;
1894
1894
#if !defined(__CYGWIN32__ )&& !defined(__QNX__ )
1895
1895
StreamClose (ServerSock_UNIX );
1896
+ ServerSock_UNIX = INVALID_SOCK ;
1896
1897
#endif
1897
1898
1898
1899
/* Save port etc. for ps status */
@@ -2024,10 +2025,13 @@ ExitPostmaster(int status)
2024
2025
*/
2025
2026
if (ServerSock_INET != INVALID_SOCK )
2026
2027
StreamClose (ServerSock_INET );
2028
+ ServerSock_INET = INVALID_SOCK ;
2027
2029
#if !defined(__CYGWIN32__ )&& !defined(__QNX__ )
2028
2030
if (ServerSock_UNIX != INVALID_SOCK )
2029
2031
StreamClose (ServerSock_UNIX );
2032
+ ServerSock_UNIX = INVALID_SOCK ;
2030
2033
#endif
2034
+
2031
2035
proc_exit (status );
2032
2036
}
2033
2037
@@ -2190,11 +2194,15 @@ SSDataBase(bool startup)
2190
2194
char nbbuf [ARGV_SIZE ];
2191
2195
char dbbuf [ARGV_SIZE ];
2192
2196
2197
+ /* Lose the postmaster's on-exit routines and port connections */
2193
2198
on_exit_reset ();
2199
+
2194
2200
if (NetServer )
2195
2201
StreamClose (ServerSock_INET );
2202
+ ServerSock_INET = INVALID_SOCK ;
2196
2203
#if !defined(__CYGWIN32__ )&& !defined(__QNX__ )
2197
2204
StreamClose (ServerSock_UNIX );
2205
+ ServerSock_UNIX = INVALID_SOCK ;
2198
2206
#endif
2199
2207
2200
2208
StrNCpy (execbuf ,Execfile ,MAXPGPATH );