mirror of
https://github.com/postgres/postgres.git
synced 2025-11-15 03:41:20 +03:00
Use closesocket() for all socket/pipe closing, because Win32 requires
it, and map that to close() on Unix.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.99 2003/04/17 22:26:01 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.100 2003/04/25 01:24:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1212,7 +1212,7 @@ ident_inet(const struct in_addr remote_ip_addr,
|
||||
ident_user);
|
||||
}
|
||||
}
|
||||
close(sock_fd);
|
||||
closesocket(sock_fd);
|
||||
}
|
||||
}
|
||||
return ident_return;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.151 2003/04/22 00:08:06 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.152 2003/04/25 01:24:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -150,7 +150,7 @@ pq_close(void)
|
||||
if (MyProcPort != NULL)
|
||||
{
|
||||
secure_close(MyProcPort);
|
||||
close(MyProcPort->sock);
|
||||
closesocket(MyProcPort->sock);
|
||||
/* make sure any subsequent attempts to do I/O fail cleanly */
|
||||
MyProcPort->sock = -1;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
|
||||
snprintf(portNumberStr, sizeof(portNumberStr), "%d", portNumber);
|
||||
service = portNumberStr;
|
||||
}
|
||||
|
||||
|
||||
ret = getaddrinfo2(hostName, service, &hint, &addrs);
|
||||
if (ret || addrs == NULL)
|
||||
{
|
||||
@@ -470,7 +470,7 @@ StreamConnection(int server_fd, Port *port)
|
||||
void
|
||||
StreamClose(int sock)
|
||||
{
|
||||
close(sock);
|
||||
closesocket(sock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* Copyright (c) 2001, PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.32 2003/03/20 03:34:56 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.33 2003/04/25 01:24:00 momjian Exp $
|
||||
* ----------
|
||||
*/
|
||||
#include "postgres.h"
|
||||
@@ -235,7 +235,7 @@ pgstat_init(void)
|
||||
|
||||
startup_failed:
|
||||
if (pgStatSock >= 0)
|
||||
close(pgStatSock);
|
||||
closesocket(pgStatSock);
|
||||
pgStatSock = -1;
|
||||
|
||||
/* Adjust GUC variables to suppress useless activity */
|
||||
@@ -359,10 +359,10 @@ void
|
||||
pgstat_close_sockets(void)
|
||||
{
|
||||
if (pgStatPmPipe[0] >= 0)
|
||||
close(pgStatPmPipe[0]);
|
||||
closesocket(pgStatPmPipe[0]);
|
||||
pgStatPmPipe[0] = -1;
|
||||
if (pgStatPmPipe[1] >= 0)
|
||||
close(pgStatPmPipe[1]);
|
||||
closesocket(pgStatPmPipe[1]);
|
||||
pgStatPmPipe[1] = -1;
|
||||
}
|
||||
|
||||
@@ -1120,7 +1120,7 @@ pgstat_main(void)
|
||||
* Close the writing end of the postmaster pipe, so we'll see it
|
||||
* closing when the postmaster terminates and can terminate as well.
|
||||
*/
|
||||
close(pgStatPmPipe[1]);
|
||||
closesocket(pgStatPmPipe[1]);
|
||||
pgStatPmPipe[1] = -1;
|
||||
|
||||
/*
|
||||
@@ -1167,13 +1167,13 @@ pgstat_main(void)
|
||||
|
||||
case 0:
|
||||
/* child becomes collector process */
|
||||
close(pgStatPipe[1]);
|
||||
close(pgStatSock);
|
||||
closesocket(pgStatPipe[1]);
|
||||
closesocket(pgStatSock);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* parent becomes buffer process */
|
||||
close(pgStatPipe[0]);
|
||||
closesocket(pgStatPipe[0]);
|
||||
pgstat_recvbuffer();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user